opik 1.9.97 → 1.9.99
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 +28 -28
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +28 -28
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
'use strict';var ansiEscapes=require('ansi-escapes'),tslog=require('tslog'),
|
|
2
|
-
`)}var Sr=class extends Error{constructor(o){super(o),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var D=class extends w{constructor(o,e){super({message:"BadRequestError",statusCode:400,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var $=class extends w{constructor(o,e){super({message:"ConflictError",statusCode:409,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var ne=class extends w{constructor(o,e){super({message:"ForbiddenError",statusCode:403,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var I=class extends w{constructor(o,e){super({message:"NotFoundError",statusCode:404,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var qe=class extends w{constructor(o,e){super({message:"NotImplementedError",statusCode:501,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var re=class extends w{constructor(o,e){super({message:"UnauthorizedError",statusCode:401,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var Z=class extends w{constructor(o,e){super({message:"UnprocessableEntityError",statusCode:422,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var vi={};W(vi,{GetWebhookExamplesRequestAlertType:()=>mf});var mf={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var Yn={};var ji={};W(ji,{AttachmentListRequestEntityType:()=>df,DownloadAttachmentRequestEntityType:()=>uf,StartMultipartUploadRequestEntityType:()=>ff,UploadAttachmentRequestEntityType:()=>hf});var df={Trace:"trace",Span:"span"};var uf={Trace:"trace",Span:"span"};var ff={Trace:"trace",Span:"span"};var hf={Trace:"trace",Span:"span"};var Xn={};var Zn={};var On={};var qn={};var Ei={};W(Ei,{DatasetUpdateVisibility:()=>gf,DatasetWriteVisibility:()=>yf});var gf={Private:"private",Public:"public"};var yf={Private:"private",Public:"public"};var Ci={};W(Ci,{ExperimentWriteStatus:()=>bf,ExperimentWriteType:()=>xf});var bf={Running:"running",Completed:"completed",Cancelled:"cancelled"};var xf={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var Ii={};W(Ii,{FindFeedbackDefinitionsRequestType:()=>Rf});var Rf={Numerical:"numerical",Categorical:"categorical",Boolean:"boolean"};var es={};var Di={};W(Di,{ProviderApiKeyWriteProvider:()=>wf});var wf={Openai:"openai",Anthropic:"anthropic",Gemini:"gemini",Openrouter:"openrouter",VertexAi:"vertex-ai",Bedrock:"bedrock",CustomLlm:"custom-llm",OpikFree:"opik-free"};var rs={};var ts={};var Ui={};W(Ui,{OptimizationUpdateStatus:()=>_f});var _f={Running:"running",Completed:"completed",Cancelled:"cancelled",Initialized:"initialized",Error:"error"};var Fi={};W(Fi,{ProjectMetricRequestPublicInterval:()=>zf,ProjectMetricRequestPublicMetricType:()=>kf,ProjectUpdateVisibility:()=>Sf,ProjectWriteVisibility:()=>Pf});var zf={Hourly:"HOURLY",Daily:"DAILY",Weekly:"WEEKLY"};var kf={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",SpanFeedbackScores:"SPAN_FEEDBACK_SCORES",SpanCount:"SPAN_COUNT",SpanDuration:"SPAN_DURATION",SpanTokenUsage:"SPAN_TOKEN_USAGE"};var Sf={Private:"private",Public:"public"};var Pf={Private:"private",Public:"public"};var Ni={};W(Ni,{CreatePromptVersionDetailTemplateStructure:()=>Af,PromptWriteTemplateStructure:()=>Tf,PromptWriteType:()=>vf});var Af={Text:"text",Chat:"chat"};var Tf={Text:"text",Chat:"chat"};var vf={Mustache:"mustache",Jinja2:"jinja2"};var os={};var is={};var Mi={};W(Mi,{FindFeedbackScoreNames1RequestType:()=>jf,GetSpanStatsRequestType:()=>Ef,GetSpansByProjectRequestType:()=>Cf,SpanSearchStreamRequestPublicType:()=>If});var jf={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Ef={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Cf={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var If={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var as={};var ns={};var ss={};var ps={};var Qg={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var Yg={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var Xg={ScopeProject:"scope:project",ThresholdFeedbackScore:"threshold:feedback_score",ThresholdCost:"threshold:cost",ThresholdLatency:"threshold:latency",ThresholdErrors:"threshold:errors"};var Zg={ScopeProject:"scope:project",ThresholdFeedbackScore:"threshold:feedback_score",ThresholdCost:"threshold:cost",ThresholdLatency:"threshold:latency",ThresholdErrors:"threshold:errors"};var Og={ScopeProject:"scope:project",ThresholdFeedbackScore:"threshold:feedback_score",ThresholdCost:"threshold:cost",ThresholdLatency:"threshold:latency",ThresholdErrors:"threshold:errors"};var qg={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 ey={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 ry={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 ty={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var oy={Trace:"trace",Thread:"thread"};var iy={Trace:"trace",Thread:"thread"};var ay={Trace:"trace",Thread:"thread"};var ny={System:"system",User:"user",Assistant:"assistant",Tool:"tool",Function:"function"};var sy={Evaluator:"evaluator"};var py={Evaluator:"evaluator"};var cy={Evaluator:"evaluator"};var ly={Evaluator:"evaluator"};var my={Evaluator:"evaluator"};var dy={Topic:"TOPIC",Pii:"PII"};var uy={Topic:"TOPIC",Pii:"PII"};var fy={Passed:"passed",Failed:"failed"};var hy={Passed:"passed",Failed:"failed"};var gy={String:"string",Number:"number",Object:"object",Boolean:"boolean",Array:"array",Null:"null"};var yy={String:"string",Number:"number",Object:"object",Boolean:"boolean",Array:"array",Null:"null"};var by={String:"string",Number:"number",Object:"object",Boolean:"boolean",Array:"array",Null:"null"};var xy={Trace:"trace",Span:"span"};var Ry={Pending:"PENDING",Processing:"PROCESSING",Completed:"COMPLETED",Failed:"FAILED"};var wy={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var _y={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 zy={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var ky={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var cs={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var Sy={Unknown:"unknown",Processing:"processing",Completed:"completed",Failed:"failed"};var Py={Private:"private",Public:"public"};var Ay={Unknown:"unknown",Processing:"processing",Completed:"completed",Failed:"failed"};var Ty={Private:"private",Public:"public"};var vy={Trace:"trace",Span:"span"};var jy={Default:"default",Hidden:"hidden"};var Ey={Default:"default",Hidden:"hidden"};var Cy={Default:"default",Hidden:"hidden"};var Iy={Running:"running",Completed:"completed",Cancelled:"cancelled"};var Dy={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var Uy={Running:"running",Completed:"completed",Cancelled:"cancelled"};var ls={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var Fy={Running:"running",Completed:"completed",Cancelled:"cancelled"};var Ny={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var My={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Wy={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var By={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Vy={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Ly={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Hy={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Jy={Topic:"TOPIC",Pii:"PII"};var Gy={Passed:"passed",Failed:"failed"};var Ky={Topic:"TOPIC",Pii:"PII"};var $y={Passed:"passed",Failed:"failed"};var Qy={System:"SYSTEM",User:"USER",Ai:"AI",ToolExecutionResult:"TOOL_EXECUTION_RESULT",Custom:"CUSTOM"};var Yy={System:"SYSTEM",User:"USER",Ai:"AI",ToolExecutionResult:"TOOL_EXECUTION_RESULT",Custom:"CUSTOM"};var Xy={System:"SYSTEM",User:"USER",Ai:"AI",ToolExecutionResult:"TOOL_EXECUTION_RESULT",Custom:"CUSTOM"};var Zy={Boolean:"BOOLEAN",Integer:"INTEGER",Double:"DOUBLE"};var Oy={Boolean:"BOOLEAN",Integer:"INTEGER",Double:"DOUBLE"};var qy={Boolean:"BOOLEAN",Integer:"INTEGER",Double:"DOUBLE"};var eb={Info:"INFO",Warn:"WARN",Error:"ERROR",Debug:"DEBUG",Trace:"TRACE"};var rb={Trace:"trace",Thread:"thread",Span:"span"};var tb={Running:"running",Completed:"completed",Cancelled:"cancelled",Initialized:"initialized",Error:"error"};var ob={Running:"running",Completed:"completed",Cancelled:"cancelled",Initialized:"initialized",Error:"error"};var ib={Running:"running",Completed:"completed",Cancelled:"cancelled",Initialized:"initialized",Error:"error"};var ab={Private:"private",Public:"public"};var nb={Hourly:"HOURLY",Daily:"DAILY",Weekly:"WEEKLY"};var sb={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",SpanFeedbackScores:"SPAN_FEEDBACK_SCORES",SpanCount:"SPAN_COUNT",SpanDuration:"SPAN_DURATION",SpanTokenUsage:"SPAN_TOKEN_USAGE"};var pb={Private:"private",Public:"public"};var cb={Private:"private",Public:"public"};var lb={Text:"text",Chat:"chat"};var mb={Text:"text",Chat:"chat"};var db={Text:"text",Chat:"chat"};var ub={Mustache:"mustache",Jinja2:"jinja2"};var fb={Text:"text",Chat:"chat"};var hb={Mustache:"mustache",Jinja2:"jinja2"};var gb={Text:"text",Chat:"chat"};var yb={Mustache:"mustache",Jinja2:"jinja2"};var bb={Text:"text",Chat:"chat"};var xb={Mustache:"mustache",Jinja2:"jinja2"};var Rb={Openai:"openai",Anthropic:"anthropic",Gemini:"gemini",Openrouter:"openrouter",VertexAi:"vertex-ai",Bedrock:"bedrock",CustomLlm:"custom-llm",OpikFree:"opik-free"};var wb={Openai:"openai",Anthropic:"anthropic",Gemini:"gemini",Openrouter:"openrouter",VertexAi:"vertex-ai",Bedrock:"bedrock",CustomLlm:"custom-llm",OpikFree:"opik-free"};var _b={Text:"text",JsonObject:"json_object",JsonSchema:"json_schema"};var zb={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var kb={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 Sb={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 Pb={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 Ab={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Ce={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Tb={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var vb={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var jb={Function:"function"};var Eb={Function:"function"};var Cb={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 Ib={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 Db={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 Ub={Default:"default",Hidden:"hidden"};var Fb={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 Nb={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 Mb={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 Wb={Active:"active",Inactive:"inactive"};var Bb={Default:"default",Hidden:"hidden"};var Vb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Lb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Hb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Jb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Gb={Success:"success",Failure:"failure"};function z(...n){let o={};for(let[e,t]of n.filter(i=>i!=null).flatMap(i=>Object.entries(i))){let i=e.toLowerCase();t!=null?o[i]=t:i in o&&delete o[i];}return o}function P(...n){let o={};for(let[e,t]of n.filter(i=>i!=null).flatMap(i=>Object.entries(i))){let i=e.toLowerCase();t!=null&&(o[i]=t);}return o}var ms={get:async(n,o)=>typeof n=="function"?n(o):n};var fe={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},Df={[fe.Debug]:1,[fe.Info]:2,[fe.Warn]:3,[fe.Error]:4},er=class{debug(o,...e){console.debug(o,...e);}info(o,...e){console.info(o,...e);}warn(o,...e){console.warn(o,...e);}error(o,...e){console.error(o,...e);}},Pr=class{constructor(o){this.level=Df[o.level],this.logger=o.logger,this.silent=o.silent;}shouldLog(o){return !this.silent&&this.level<=Df[o]}isDebug(){return this.shouldLog(fe.Debug)}debug(o,...e){this.isDebug()&&this.logger.debug(o,...e);}isInfo(){return this.shouldLog(fe.Info)}info(o,...e){this.isInfo()&&this.logger.info(o,...e);}isWarn(){return this.shouldLog(fe.Warn)}warn(o,...e){this.isWarn()&&this.logger.warn(o,...e);}isError(){return this.shouldLog(fe.Error)}error(o,...e){this.isError()&&this.logger.error(o,...e);}};function ds(n){return n==null?Kb:n instanceof Pr?n:(n=n!=null?n:{},(n.level)!=null||(n.level=fe.Info),(n.logger)!=null||(n.logger=new er),(n.silent)!=null||(n.silent=true),new Pr(n))}var Kb=new Pr({level:fe.Info,logger:new er,silent:true});var Qb={arrayFormat:"indices",encode:true};function Uf(n,o){if(n===void 0||n===null)return "";let e=String(n);return o?encodeURIComponent(e):e}function us(n,o="",e){let t=[];for(let[i,a]of Object.entries(n)){let s=o?`${o}[${i}]`:i;if(a!==void 0)if(Array.isArray(a)){if(a.length===0)continue;for(let p=0;p<a.length;p++){let l=a[p];if(l!==void 0)if(typeof l=="object"&&!Array.isArray(l)&&l!==null){let c=e.arrayFormat==="indices"?`${s}[${p}]`:s;t.push(...us(l,c,e));}else {let c=e.arrayFormat==="indices"?`${s}[${p}]`:s,d=e.encode?encodeURIComponent(c):c;t.push(`${d}=${Uf(l,e.encode)}`);}}}else if(typeof a=="object"&&a!==null){if(Object.keys(a).length===0)continue;t.push(...us(a,s,e));}else {let p=e.encode?encodeURIComponent(s):s;t.push(`${p}=${Uf(a,e.encode)}`);}}return t}function rr(n,o){return n==null||typeof n!="object"?"":us(n,"",{...Qb,...o}).join("&")}function Ff(n,o){let e=rr(o,{arrayFormat:"repeat"});return e?`${n}?${e}`:n}function Nf(n){let o={get bodyUsed(){return n.bodyUsed},stream:()=>n.body,arrayBuffer:n.arrayBuffer.bind(n),blob:n.blob.bind(n)};return "bytes"in n&&typeof n.bytes=="function"&&(o.bytes=n.bytes.bind(n)),o}async function Wi(n,o){switch(o){case "binary-response":return Nf(n);case "blob":return await n.blob();case "arrayBuffer":return await n.arrayBuffer();case "sse":return n.body==null?{ok:false,error:{reason:"body-is-null",statusCode:n.status}}:n.body;case "streaming":return n.body==null?{ok:false,error:{reason:"body-is-null",statusCode:n.status}}:n.body;case "text":return await n.text()}let e=await n.text();if(e.length>0)try{return tt(e)}catch{return {ok:false,error:{reason:"non-json",statusCode:n.status,rawBody:e}}}}async function Mf(n){var e,t,i;let o=(e=n.headers.get("Content-Type"))==null?void 0:e.toLowerCase();if(o==null||o.length===0)return Wi(n);switch(o.indexOf(";")!==-1&&(o=(i=(t=o.split(";")[0])==null?void 0:t.trim())!=null?i:""),o){case "application/hal+json":case "application/json":case "application/ld+json":case "application/problem+json":case "application/vnd.api+json":case "text/json":{let a=await n.text();return a.length>0?tt(a):void 0}default:if(o.startsWith("application/vnd.")&&o.endsWith("+json")){let a=await n.text();return a.length>0?tt(a):void 0}return await n.text()}}async function Wf(){return fetch}async function Bf({body:n,type:o}){return o==="form"?rr(n,{arrayFormat:"repeat",encode:true}):o.includes("json")?Se(n):n}var Le;typeof globalThis.Headers!="undefined"?Le=globalThis.Headers:Le=class Vf{constructor(o){if(this.headers=new Map,o)if(o instanceof Vf)o.forEach((e,t)=>this.append(t,e));else if(Array.isArray(o))for(let[e,t]of o)if(typeof e=="string"&&typeof t=="string")this.append(e,t);else throw new TypeError("Each header entry must be a [string, string] tuple");else for(let[e,t]of Object.entries(o))if(typeof t=="string")this.append(e,t);else throw new TypeError("Header values must be strings")}append(o,e){let t=o.toLowerCase(),i=this.headers.get(t)||[];this.headers.set(t,[...i,e]);}delete(o){let e=o.toLowerCase();this.headers.delete(e);}get(o){let e=o.toLowerCase(),t=this.headers.get(e);return t?t.join(", "):null}has(o){let e=o.toLowerCase();return this.headers.has(e)}set(o,e){let t=o.toLowerCase();this.headers.set(t,[e]);}forEach(o,e){let t=e?o.bind(e):o;this.headers.forEach((i,a)=>t(i.join(", "),a,this));}getSetCookie(){return this.headers.get("set-cookie")||[]}*entries(){for(let[o,e]of this.headers.entries())yield [o,e.join(", ")];}*keys(){yield*this.headers.keys();}*values(){for(let o of this.headers.values())yield o.join(", ");}[Symbol.iterator](){return this.entries()}};var Yb="timeout";function Lf(n){let o=new AbortController,e=setTimeout(()=>o.abort(Yb),n);return {signal:o.signal,abortId:e}}function Hf(...n){let o=n.length===1&&Array.isArray(n[0])?n[0]:n,e=new AbortController;for(let t of o){if(t.aborted){e.abort(t==null?void 0:t.reason);break}t.addEventListener("abort",()=>e.abort(t==null?void 0:t.reason),{signal:e.signal});}return e.signal}var Jf=async(n,o,e,t,i,a,s,p,l)=>{let c=[],d;if(a!=null){let{signal:u,abortId:h}=Lf(a);d=h,c.push(u);}s!=null&&c.push(s);let m=Hf(c),f=await n(o,{method:e,headers:t,body:i,signal:m,credentials:p?"include":void 0,duplex:l});return d!=null&&clearTimeout(d),f};var Bi={headers:new Le,redirected:false,status:499,statusText:"Client Closed Request",type:"error",url:""},Vi={headers:new Le,redirected:false,status:0,statusText:"Unknown Error",type:"error",url:""};function Li(n){return {headers:n.headers,redirected:n.redirected,status:n.status,statusText:n.statusText,type:n.type,url:n.url}}function Xb(n){let o=1+Math.random()*.2;return n*o}function Zb(n){let o=1+(Math.random()-.5)*.2;return n*o}function Ob(n,o){let e=n.headers.get("Retry-After");if(e){let i=parseInt(e,10);if(!Number.isNaN(i)&&i>0)return Math.min(i*1e3,6e4);let a=new Date(e);if(!Number.isNaN(a.getTime())){let s=a.getTime()-Date.now();if(s>0)return Math.min(Math.max(s,0),6e4)}}let t=n.headers.get("X-RateLimit-Reset");if(t){let i=parseInt(t,10);if(!Number.isNaN(i)){let a=i*1e3-Date.now();if(a>0)return Xb(Math.min(a,6e4))}}return Zb(Math.min(1e3*2**o,6e4))}async function Gf(n,o=2){let e=await n();for(let t=0;t<o&&([408,429].includes(e.status)||e.status>=500);++t){let i=Ob(e,t);await new Promise(a=>setTimeout(a,i)),e=await n();}return e}var qb=new Set(["authorization","www-authenticate","x-api-key","api-key","apikey","x-api-token","x-auth-token","auth-token","cookie","set-cookie","proxy-authorization","proxy-authenticate","x-csrf-token","x-xsrf-token","x-session-token","x-access-token"]);function fs(n){let o={};for(let[e,t]of n instanceof Le?n.entries():Object.entries(n))qb.has(e.toLowerCase())?o[e]="[REDACTED]":o[e]=t;return o}var hs=new Set(["api_key","api-key","apikey","token","access_token","access-token","auth_token","auth-token","password","passwd","secret","api_secret","api-secret","apisecret","key","session","session_id","session-id"]);function ex(n){if(n==null)return n;let o={};for(let[e,t]of Object.entries(n))hs.has(e.toLowerCase())?o[e]="[REDACTED]":o[e]=t;return o}function tr(n){let o=n.indexOf("://");if(o===-1)return n;let e=o+3,t=n.indexOf("/",e),i=n.indexOf("?",e),a=n.indexOf("#",e),s=Math.min(t===-1?n.length:t,i===-1?n.length:i,a===-1?n.length:a),p=-1;for(let h=e;h<s;h++)n[h]==="@"&&(p=h);if(p!==-1&&(n=`${n.slice(0,e)}[REDACTED]@${n.slice(p+1)}`),i=n.indexOf("?"),i===-1)return n;a=n.indexOf("#",i);let l=a!==-1?a:n.length,c=n.slice(i+1,l);if(c.length===0)return n;let d=c.toLowerCase();if(!(d.includes("token")||d.includes("key")||d.includes("password")||d.includes("passwd")||d.includes("secret")||d.includes("session")||d.includes("auth")))return n;let f=[],u=c.split("&");for(let h of u){let g=h.indexOf("=");if(g===-1){f.push(h);continue}let x=h.slice(0,g),T=hs.has(x.toLowerCase());if(!T&&x.includes("%"))try{let v=decodeURIComponent(x);T=hs.has(v.toLowerCase());}catch{}f.push(T?`${x}=[REDACTED]`:h);}return n.slice(0,i+1)+f.join("&")+n.slice(l)}async function rx(n){var e;let o=new Le;if(o.set("Accept",n.responseType==="json"?"application/json":n.responseType==="text"?"text/plain":"*/*"),n.body!==void 0&&n.contentType!=null&&o.set("Content-Type",n.contentType),n.headers==null)return o;for(let[t,i]of Object.entries(n.headers)){let a=await ms.get(i,{endpointMetadata:(e=n.endpointMetadata)!=null?e:{}});if(typeof a=="string"){o.set(t,a);continue}a!=null&&o.set(t,`${a}`);}return o}async function tx(n){var s,p,l;let o=Ff(n.url,n.queryParameters),e=await Bf({body:n.body,type:(s=n.requestType)!=null?s:"other"}),t=(p=n.fetchFn)!=null?p:await Wf(),i=await rx(n),a=ds(n.logging);if(a.isDebug()){let c={method:n.method,url:tr(o),headers:fs(i),queryParameters:ex(n.queryParameters),hasBody:e!=null};a.debug("Making HTTP request",c);}try{let c=await Gf(async()=>Jf(t,o,n.method,i,e,n.timeoutMs,n.abortSignal,n.withCredentials,n.duplex),n.maxRetries);if(c.status>=200&&c.status<400){if(a.isDebug()){let m={method:n.method,url:tr(o),statusCode:c.status,responseHeaders:fs(c.headers)};a.debug("HTTP request succeeded",m);}return {ok:!0,body:await Wi(c,n.responseType),headers:c.headers,rawResponse:Li(c)}}else {if(a.isError()){let d={method:n.method,url:tr(o),statusCode:c.status,responseHeaders:fs(Object.fromEntries(c.headers.entries()))};a.error("HTTP request failed with error status",d);}return {ok:!1,error:{reason:"status-code",statusCode:c.status,body:await Mf(c)},rawResponse:Li(c)}}}catch(c){if((l=n.abortSignal)!=null&&l.aborted){if(a.isError()){let d={method:n.method,url:tr(o)};a.error("HTTP request was aborted",d);}return {ok:false,error:{reason:"unknown",errorMessage:"The user aborted a request"},rawResponse:Bi}}else if(c instanceof Error&&c.name==="AbortError"){if(a.isError()){let d={method:n.method,url:tr(o),timeoutMs:n.timeoutMs};a.error("HTTP request timed out",d);}return {ok:false,error:{reason:"timeout"},rawResponse:Bi}}else if(c instanceof Error){if(a.isError()){let d={method:n.method,url:tr(o),errorMessage:c.message};a.error("HTTP request failed with error",d);}return {ok:false,error:{reason:"unknown",errorMessage:c.message},rawResponse:Vi}}if(a.isError()){let d={method:n.method,url:tr(o),error:Se(c)};a.error("HTTP request failed with unknown error",d);}return {ok:false,error:{reason:"unknown",errorMessage:Se(c)},rawResponse:Vi}}}var k=tx;var _=class n extends Promise{constructor(o){super(e=>{e(void 0);}),this.innerPromise=o;}static fromFunction(o,...e){return new n(o(...e))}static interceptFunction(o){return (...e)=>n.fromPromise(o(...e))}static fromPromise(o){return new n(o)}static fromExecutor(o){let e=new Promise(o);return new n(e)}static fromResult(o){let e=Promise.resolve(o);return new n(e)}unwrap(){return this.unwrappedPromise||(this.unwrappedPromise=this.innerPromise.then(({data:o})=>o)),this.unwrappedPromise}then(o,e){return this.unwrap().then(o,e)}catch(o){return this.unwrap().catch(o)}finally(o){return this.unwrap().finally(o)}async withRawResponse(){return await this.innerPromise}};var b={get:async n=>typeof n=="function"?n():n};var Rs={};W(Rs,{toBinaryUploadRequest:()=>ox,toMultipartDataPart:()=>gs});async function ox(n){let{data:o,filename:e,contentLength:t,contentType:i}=await ys(n),a={body:o,headers:{}};return e&&(a.headers["Content-Disposition"]=`attachment; filename="${e}"`),i&&(a.headers["Content-Type"]=i),t!=null&&(a.headers["Content-Length"]=t.toString()),a}async function gs(n){let{data:o,filename:e,contentType:t}=await ys(n,{noSniffFileSize:true});return {data:o,filename:e,contentType:t}}async function ys(n,{noSniffFileSize:o}={}){var e,t,i,a,s;if(ix(n))return ys({data:n},{noSniffFileSize:o});if("path"in n){let p=await import('fs');if(!p||!p.createReadStream)throw new Error("File path uploads are not supported in this environment.");let l=p.createReadStream(n.path),c=(e=n.contentLength)!=null?e:o===true?void 0:await Kf(n.path),d=(t=n.filename)!=null?t:$f(n.path);return {data:l,filename:d,contentType:n.contentType,contentLength:c}}if("data"in n){let p=n.data,l=(i=n.contentLength)!=null?i:await nx(p,{noSniffFileSize:o}),c=(a=n.filename)!=null?a:ax(p);return {data:p,filename:c,contentType:(s=n.contentType)!=null?s:sx(p),contentLength:l}}throw new Error(`Invalid FileUpload of type ${typeof n}: ${JSON.stringify(n)}`)}function ix(n){return Yf(n)||Xf(n)||Zf(n)||mx(n)||bs(n)||xs(n)||cx(n)||lx(n)}async function Kf(n){try{let o=await import('fs');return !o||!o.promises||!o.promises.stat?void 0:(await o.promises.stat(n)).size}catch{return}}function ax(n){if(px(n))return n.name;if(Qf(n))return $f(n.path.toString())}async function nx(n,{noSniffFileSize:o}={}){if(Yf(n))return n.length;if(Xf(n)||Zf(n))return n.byteLength;if(bs(n)||xs(n))return n.size;if(o!==true&&Qf(n))return await Kf(n.path.toString())}function sx(n){if(bs(n)||xs(n))return n.type}function $f(n){let o=n.lastIndexOf("/"),e=n.lastIndexOf("\\"),t=Math.max(o,e);return t>=0?n.substring(t+1):n}function px(n){return typeof n=="object"&&n!=null&&"name"in n}function Qf(n){return typeof n=="object"&&n!=null&&"path"in n}function cx(n){return typeof n=="object"&&n!=null&&("read"in n||"pipe"in n)}function lx(n){return typeof n=="object"&&n!=null&&"getReader"in n}function Yf(n){return typeof Buffer!="undefined"&&Buffer.isBuffer&&Buffer.isBuffer(n)}function Xf(n){return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView(n)}function Zf(n){return typeof ArrayBuffer!="undefined"&&n instanceof ArrayBuffer}function mx(n){return typeof Uint8Array!="undefined"&&n instanceof Uint8Array}function bs(n){return typeof Blob!="undefined"&&n instanceof Blob}function xs(n){return typeof File!="undefined"&&n instanceof File}var Ar=dx();function dx(){var l,c,d,m,f;return typeof window!="undefined"&&typeof window.document!="undefined"?{type:"browser",version:window.navigator.userAgent}:typeof globalThis!="undefined"&&((l=globalThis==null?void 0:globalThis.navigator)==null?void 0:l.userAgent)==="Cloudflare-Workers"?{type:"workerd"}:typeof EdgeRuntime=="string"?{type:"edge-runtime"}:typeof self=="object"&&typeof(self==null?void 0:self.importScripts)=="function"&&(((c=self.constructor)==null?void 0:c.name)==="DedicatedWorkerGlobalScope"||((d=self.constructor)==null?void 0:d.name)==="ServiceWorkerGlobalScope"||((m=self.constructor)==null?void 0:m.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 navigator!="undefined"&&(navigator==null?void 0:navigator.product)==="ReactNative"?{type:"react-native"}:typeof process!="undefined"&&"version"in process&&!!process.version&&"versions"in process&&!!((f=process.versions)!=null&&f.node)?{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])}:{type:"unknown"}}async function Of(){return new ws}var ws=class{constructor(){this.fd=new FormData;}async setup(){}append(o,e){this.fd.append(o,String(e));}async appendFile(o,e){let{data:t,filename:i,contentType:a}=await gs(e),s=await yx(t,a);i?this.fd.append(o,s,i):this.fd.append(o,s);}getRequest(){return {body:this.fd,headers:{},duplex:"half"}}};function ux(n){return typeof n=="object"&&n!=null&&("read"in n||"pipe"in n)}function qf(n){return typeof n=="object"&&n!=null&&"getReader"in n}function fx(n){return typeof Buffer!="undefined"&&Buffer.isBuffer&&Buffer.isBuffer(n)}function hx(n){return ArrayBuffer.isView(n)}async function gx(n){if(Ar.type==="node"){let{Readable:o}=await import('stream');if(n instanceof o){let e=[];for await(let t of n)e.push(Buffer.isBuffer(t)?t:Buffer.from(t));return Buffer.concat(e)}}if(qf(n)){let o=n.getReader(),e=[];try{for(;;){let{done:s,value:p}=await o.read();if(s)break;e.push(p);}}finally{o.releaseLock();}let t=e.reduce((s,p)=>s+p.length,0),i=new Uint8Array(t),a=0;for(let s of e)i.set(s,a),a+=s.length;return Buffer.from(i)}throw new Error(`Unsupported stream type: ${typeof n}. Expected Node.js Readable stream or Web ReadableStream.`)}async function yx(n,o){if(ux(n)||qf(n)){let e=await gx(n);return new Blob([e],{type:o})}return n instanceof Blob?n:fx(n)?new Blob([n],{type:o}):n instanceof ArrayBuffer?new Blob([n],{type:o}):hx(n)?new Blob([n],{type:o}):typeof n=="string"?new Blob([n],{type:o}):typeof n=="object"&&n!==null?new Blob([Se(n)],{type:o!=null?o:"application/json"}):new Blob([String(n)],{type:o})}var ot={};W(ot,{ConsoleLogger:()=>er,LogLevel:()=>fe,Logger:()=>Pr,createLogger:()=>ds});var r={};W(r,{JsonError:()=>Tr,ParseError:()=>vr,any:()=>fh,bigint:()=>rh,boolean:()=>hh,booleanLiteral:()=>dh,date:()=>th,discriminant:()=>Sh,enum_:()=>Ji,getObjectLikeUtils:()=>Pe,getObjectUtils:()=>or,getSchemaUtils:()=>J,isProperty:()=>He,lazy:()=>oh,lazyObject:()=>lh,list:()=>Ki,never:()=>gh,number:()=>yh,object:()=>Gi,objectWithoutOptionalProperties:()=>ch,optional:()=>_s,property:()=>ah,record:()=>wh,set:()=>_h,string:()=>bh,stringLiteral:()=>uh,transform:()=>zs,undiscriminatedUnion:()=>kh,union:()=>Ah,unknown:()=>xh,withParsedProperties:()=>Ss});var N={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",NEVER:"never",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"};function L(n,o){return `Expected ${o}. Received ${bx(n)}.`}function bx(n){if(Array.isArray(n))return "list";if(n===null)return "null";if(n instanceof BigInt)return "BigInt";switch(typeof n){case "string":return `"${n}"`;case "bigint":case "number":case "boolean":case "undefined":return `${n}`}return typeof n}function te(n){return {...n,json:eh(n.json),parse:eh(n.parse)}}function eh(n){return (o,e)=>{let t=n(o,e),{skipValidation:i=false}=e!=null?e:{};return !t.ok&&i?(console.warn(["Failed to validate.",...t.errors.map(a=>" - "+(a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message))].join(`
|
|
3
|
-
`)),{ok:true,value:o}):t}}function Hi(n){return n.path.length===0?n.message:`${n.path.join(" -> ")}: ${n.message}`}var Tr=class n extends Error{constructor(e){super(e.map(Hi).join("; "));this.errors=e;Object.setPrototypeOf(this,n.prototype);}};var vr=class n extends Error{constructor(e){super(e.map(Hi).join("; "));this.errors=e;Object.setPrototypeOf(this,n.prototype);}};function J(n){return {nullable:()=>xx(n),optional:()=>_s(n),optionalNullable:()=>Rx(n),transform:o=>zs(n,o),parseOrThrow:(o,e)=>{let t=n.parse(o,e);if(t.ok)return t.value;throw new vr(t.errors)},jsonOrThrow:(o,e)=>{let t=n.json(o,e);if(t.ok)return t.value;throw new Tr(t.errors)}}}function xx(n){let o={parse:(e,t)=>e==null?{ok:true,value:null}:n.parse(e,t),json:(e,t)=>e==null?{ok:true,value:null}:n.json(e,t),getType:()=>N.NULLABLE};return {...o,...J(o)}}function _s(n){let o={parse:(e,t)=>e==null?{ok:true,value:void 0}:n.parse(e,t),json:(e,t)=>t!=null&&t.omitUndefined&&e===void 0?{ok:true,value:void 0}:e==null?{ok:true,value:null}:n.json(e,t),getType:()=>N.OPTIONAL};return {...o,...J(o)}}function Rx(n){let o={parse:(e,t)=>e===void 0?{ok:true,value:void 0}:e===null?{ok:true,value:null}:n.parse(e,t),json:(e,t)=>e===void 0?{ok:true,value:void 0}:e===null?{ok:true,value:null}:n.json(e,t),getType:()=>N.OPTIONAL_NULLABLE};return {...o,...J(o)}}function zs(n,o){let e={parse:(t,i)=>{let a=n.parse(t,i);return a.ok?{ok:true,value:o.transform(a.value)}:a},json:(t,i)=>{let a=o.untransform(t);return n.json(a,i)},getType:()=>n.getType()};return {...e,...J(e)}}function rh(){let n={parse:(o,{breadcrumbsPrefix:e=[]}={})=>typeof o=="bigint"?{ok:true,value:o}:typeof o=="number"?{ok:true,value:BigInt(o)}:{ok:false,errors:[{path:e,message:L(o,"bigint | number")}]},json:(o,{breadcrumbsPrefix:e=[]}={})=>typeof o!="bigint"?{ok:false,errors:[{path:e,message:L(o,"bigint")}]}:{ok:true,value:o},getType:()=>N.BIGINT};return {...te(n),...J(n)}}var wx=/^([+-]?\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 th(){let n={parse:(o,{breadcrumbsPrefix:e=[]}={})=>typeof o!="string"?{ok:false,errors:[{path:e,message:L(o,"string")}]}:wx.test(o)?{ok:true,value:new Date(o)}:{ok:false,errors:[{path:e,message:L(o,"ISO 8601 date string")}]},json:(o,{breadcrumbsPrefix:e=[]}={})=>o instanceof Date?{ok:true,value:o.toISOString()}:{ok:false,errors:[{path:e,message:L(o,"Date object")}]},getType:()=>N.DATE};return {...te(n),...J(n)}}function oe(n,o){return ()=>{let e={parse:o,json:o,getType:()=>n};return {...te(e),...J(e)}}}function Ji(n){let o=new Set(n);return oe(N.ENUM,(t,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:a=[]}={})=>typeof t!="string"?{ok:false,errors:[{path:a,message:L(t,"string")}]}:!o.has(t)&&!i?{ok:false,errors:[{path:a,message:L(t,"enum")}]}:{ok:true,value:t})()}function oh(n){let o=ks(n);return {...o,...J(o)}}function ks(n){return {parse:(o,e)=>jr(n).parse(o,e),json:(o,e)=>jr(n).json(o,e),getType:()=>jr(n).getType()}}function jr(n){let o=n;return o.__zurg_memoized==null&&(o.__zurg_memoized=n()),o.__zurg_memoized}function it(n){return Object.entries(n)}function at(n,o){let e=new Set(o);return Object.entries(n).reduce((t,[i,a])=>(e.has(i)&&(t[i]=a),t),{})}function Ie(n){if(typeof n!="object"||n===null)return false;if(Object.getPrototypeOf(n)===null)return true;let o=n;for(;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return Object.getPrototypeOf(n)===o}function nt(n){return Object.keys(n)}function ih(n,o){let e=[],t=[];for(let i of n)o(i)?e.push(i):t.push(i);return [e,t]}function Pe(n){return {withParsedProperties:o=>Ss(n,o)}}function Ss(n,o){let e={parse:(t,i)=>{let a=n.parse(t,i);if(!a.ok)return a;let s=Object.entries(o).reduce((p,[l,c])=>({...p,[l]:typeof c=="function"?c(a.value):c}),{});return {ok:true,value:{...a.value,...s}}},json:(t,i)=>{var p;if(!Ie(t))return {ok:false,errors:[{path:(p=i==null?void 0:i.breadcrumbsPrefix)!=null?p:[],message:L(t,"object")}]};let a=new Set(Object.keys(o)),s=at(t,Object.keys(t).filter(l=>!a.has(l)));return n.json(s,i)},getType:()=>n.getType()};return {...e,...J(e),...Pe(e)}}function ah(n,o){return {rawKey:n,valueSchema:o,isProperty:true}}function He(n){return n.isProperty}function Gi(n){let o={_getRawProperties:()=>Object.entries(n).map(([e,t])=>He(t)?t.rawKey:e),_getParsedProperties:()=>nt(n),parse:(e,t)=>{let i={},a=[];for(let[s,p]of it(n)){let l=He(p)?p.rawKey:s,c=He(p)?p.valueSchema:p,d={rawKey:l,parsedKey:s,valueSchema:c};i[l]=d,ph(c)&&a.push(l);}return nh({value:e,requiredKeys:a,getProperty:s=>{let p=i[s];if(p!=null)return {transformedKey:p.parsedKey,transform:l=>{var c;return p.valueSchema.parse(l,{...t,breadcrumbsPrefix:[...(c=t==null?void 0:t.breadcrumbsPrefix)!=null?c:[],s]})}}},unrecognizedObjectKeys:t==null?void 0:t.unrecognizedObjectKeys,skipValidation:t==null?void 0:t.skipValidation,breadcrumbsPrefix:t==null?void 0:t.breadcrumbsPrefix,omitUndefined:t==null?void 0:t.omitUndefined})},json:(e,t)=>{let i=[];for(let[a,s]of it(n)){let p=He(s)?s.valueSchema:s;ph(p)&&i.push(a);}return nh({value:e,requiredKeys:i,getProperty:a=>{let s=n[a];if(s!=null)return He(s)?{transformedKey:s.rawKey,transform:p=>{var l;return s.valueSchema.json(p,{...t,breadcrumbsPrefix:[...(l=t==null?void 0:t.breadcrumbsPrefix)!=null?l:[],a]})}}:{transformedKey:a,transform:p=>{var l;return s.json(p,{...t,breadcrumbsPrefix:[...(l=t==null?void 0:t.breadcrumbsPrefix)!=null?l:[],a]})}}},unrecognizedObjectKeys:t==null?void 0:t.unrecognizedObjectKeys,skipValidation:t==null?void 0:t.skipValidation,breadcrumbsPrefix:t==null?void 0:t.breadcrumbsPrefix,omitUndefined:t==null?void 0:t.omitUndefined})},getType:()=>N.OBJECT};return {...te(o),...J(o),...Pe(o),...or(o)}}function nh({value:n,requiredKeys:o,getProperty:e,unrecognizedObjectKeys:t="fail",skipValidation:i=false,breadcrumbsPrefix:a=[]}){if(!Ie(n))return {ok:false,errors:[{path:a,message:L(n,"object")}]};let s=new Set(o),p=[],l={};for(let[c,d]of Object.entries(n)){let m=e(c);if(m!=null){s.delete(c);let f=m.transform(d);f.ok?l[m.transformedKey]=f.value:(l[c]=d,p.push(...f.errors));}else switch(t){case "fail":p.push({path:[...a,c],message:`Unexpected key "${c}"`});break;case "strip":break;case "passthrough":l[c]=d;break}}return p.push(...o.filter(c=>s.has(c)).map(c=>({path:a,message:`Missing required key "${c}"`}))),p.length===0||i?{ok:true,value:l}:{ok:false,errors:p}}function or(n){return {extend:o=>{let e={_getParsedProperties:()=>[...n._getParsedProperties(),...o._getParsedProperties()],_getRawProperties:()=>[...n._getRawProperties(),...o._getRawProperties()],parse:(t,i)=>sh({extensionKeys:o._getRawProperties(),value:t,transformBase:a=>n.parse(a,i),transformExtension:a=>o.parse(a,i),breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),json:(t,i)=>sh({extensionKeys:o._getParsedProperties(),value:t,transformBase:a=>n.json(a,i),transformExtension:a=>o.json(a,i),breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),getType:()=>N.OBJECT};return {...e,...J(e),...Pe(e),...or(e)}},passthrough:()=>{let o=new Set(n._getRawProperties()),e=new Set(n._getParsedProperties()),t={_getParsedProperties:()=>n._getParsedProperties(),_getRawProperties:()=>n._getRawProperties(),parse:(i,a)=>{let s=n.parse(i,{...a,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let p={};if(typeof i=="object"&&i!=null)for(let[l,c]of Object.entries(i))o.has(l)||(p[l]=c);return {ok:true,value:{...p,...s.value}}},json:(i,a)=>{let s=n.json(i,{...a,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let p={};if(typeof i=="object"&&i!=null)for(let[l,c]of Object.entries(i))e.has(l)||(p[l]=c);return {ok:true,value:{...p,...s.value}}},getType:()=>N.OBJECT};return {...t,...J(t),...Pe(t),...or(t)}}}}function sh({extensionKeys:n,value:o,transformBase:e,transformExtension:t,breadcrumbsPrefix:i=[]}){if(!Ie(o))return {ok:false,errors:[{path:i,message:L(o,"object")}]};let a=new Set(n),[s,p]=ih(nt(o),d=>a.has(d)),l=e(at(o,p)),c=t(at(o,s));return l.ok&&c.ok?{ok:true,value:{...l.value,...c.value}}:{ok:false,errors:[...l.ok?[]:l.errors,...c.ok?[]:c.errors]}}function ph(n){return !_x(n)}function _x(n){switch(n.getType()){case N.ANY:case N.UNKNOWN:case N.OPTIONAL:case N.OPTIONAL_NULLABLE:return true;default:return false}}function ch(n){return Gi(n)}function lh(n){let o={...ks(n),_getRawProperties:()=>jr(n)._getRawProperties(),_getParsedProperties:()=>jr(n)._getParsedProperties()};return {...o,...J(o),...Pe(o),...or(o)}}function Ki(n){let o={parse:(e,t)=>mh(e,(i,a)=>{var s;return n.parse(i,{...t,breadcrumbsPrefix:[...(s=t==null?void 0:t.breadcrumbsPrefix)!=null?s:[],`[${a}]`]})}),json:(e,t)=>mh(e,(i,a)=>{var s;return n.json(i,{...t,breadcrumbsPrefix:[...(s=t==null?void 0:t.breadcrumbsPrefix)!=null?s:[],`[${a}]`]})}),getType:()=>N.LIST};return {...te(o),...J(o)}}function mh(n,o){return Array.isArray(n)?n.map((t,i)=>o(t,i)).reduce((t,i)=>{if(t.ok&&i.ok)return {ok:true,value:[...t.value,i.value]};let a=[];return t.ok||a.push(...t.errors),i.ok||a.push(...i.errors),{ok:false,errors:a}},{ok:true,value:[]}):{ok:false,errors:[{message:L(n,"list"),path:[]}]}}function dh(n){return oe(N.BOOLEAN_LITERAL,(e,{breadcrumbsPrefix:t=[]}={})=>e===n?{ok:true,value:n}:{ok:false,errors:[{path:t,message:L(e,`${n.toString()}`)}]})()}function uh(n){return oe(N.STRING_LITERAL,(e,{breadcrumbsPrefix:t=[]}={})=>e===n?{ok:true,value:n}:{ok:false,errors:[{path:t,message:L(e,`"${n}"`)}]})()}var fh=oe(N.ANY,n=>({ok:true,value:n}));var hh=oe(N.BOOLEAN,(n,{breadcrumbsPrefix:o=[]}={})=>typeof n=="boolean"?{ok:true,value:n}:{ok:false,errors:[{path:o,message:L(n,"boolean")}]});var gh=oe(N.NEVER,(n,{breadcrumbsPrefix:o=[]}={})=>({ok:false,errors:[{path:o,message:"Expected never"}]}));var yh=oe(N.NUMBER,(n,{breadcrumbsPrefix:o=[]}={})=>typeof n=="number"?{ok:true,value:n}:{ok:false,errors:[{path:o,message:L(n,"number")}]});var bh=oe(N.STRING,(n,{breadcrumbsPrefix:o=[]}={})=>typeof n=="string"?{ok:true,value:n}:{ok:false,errors:[{path:o,message:L(n,"string")}]});var xh=oe(N.UNKNOWN,n=>({ok:true,value:n}));function wh(n,o){let e={parse:(t,i)=>Rh({value:t,isKeyNumeric:n.getType()===N.NUMBER,transformKey:a=>{var s;return n.parse(a,{...i,breadcrumbsPrefix:[...(s=i==null?void 0:i.breadcrumbsPrefix)!=null?s:[],`${a} (key)`]})},transformValue:(a,s)=>{var p;return o.parse(a,{...i,breadcrumbsPrefix:[...(p=i==null?void 0:i.breadcrumbsPrefix)!=null?p:[],`${s}`]})},breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),json:(t,i)=>Rh({value:t,isKeyNumeric:n.getType()===N.NUMBER,transformKey:a=>{var s;return n.json(a,{...i,breadcrumbsPrefix:[...(s=i==null?void 0:i.breadcrumbsPrefix)!=null?s:[],`${a} (key)`]})},transformValue:(a,s)=>{var p;return o.json(a,{...i,breadcrumbsPrefix:[...(p=i==null?void 0:i.breadcrumbsPrefix)!=null?p:[],`${s}`]})},breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),getType:()=>N.RECORD};return {...te(e),...J(e)}}function Rh({value:n,isKeyNumeric:o,transformKey:e,transformValue:t,breadcrumbsPrefix:i=[]}){return Ie(n)?it(n).reduce((a,[s,p])=>{if(p===void 0)return a;let l=a,c=s;if(o){let u=s.length>0?Number(s):NaN;Number.isNaN(u)||(c=u);}let d=e(c),m=t(p,c);if(l.ok&&d.ok&&m.ok)return {ok:true,value:{...l.value,[d.value]:m.value}};let f=[];return l.ok||f.push(...l.errors),d.ok||f.push(...d.errors),m.ok||f.push(...m.errors),{ok:false,errors:f}},{ok:true,value:{}}):{ok:false,errors:[{path:i,message:L(n,"object")}]}}function _h(n){let o=Ki(n),e={parse:(t,i)=>{let a=o.parse(t,i);return a.ok?{ok:true,value:new Set(a.value)}:a},json:(t,i)=>{var s;return t instanceof Set?o.json([...t],i):{ok:false,errors:[{path:(s=i==null?void 0:i.breadcrumbsPrefix)!=null?s:[],message:L(t,"Set")}]}},getType:()=>N.SET};return {...te(e),...J(e)}}function kh(n){let o={parse:(e,t)=>zh((i,a)=>i.parse(e,a),n,t),json:(e,t)=>zh((i,a)=>i.json(e,a),n,t),getType:()=>N.UNDISCRIMINATED_UNION};return {...te(o),...J(o)}}function zh(n,o,e){let t=[];for(let[i,a]of o.entries()){let s=n(a,{...e,skipValidation:false});if(s.ok)return s;for(let p of s.errors)t.push({path:p.path,message:`[Variant ${i}] ${p.message}`});}return {ok:false,errors:t}}function Sh(n,o){return {parsedDiscriminant:n,rawDiscriminant:o}}function Ah(n,o){let e=typeof n=="string"?n:n.rawDiscriminant,t=typeof n=="string"?n:n.parsedDiscriminant,i=Ji(nt(o)),a={parse:(s,p)=>Ph({value:s,discriminant:e,transformedDiscriminant:t,transformDiscriminantValue:l=>{var c;return i.parse(l,{allowUnrecognizedEnumValues:p==null?void 0:p.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(c=p==null?void 0:p.breadcrumbsPrefix)!=null?c:[],e]})},getAdditionalPropertiesSchema:l=>o[l],allowUnrecognizedUnionMembers:p==null?void 0:p.allowUnrecognizedUnionMembers,transformAdditionalProperties:(l,c)=>c.parse(l,p),breadcrumbsPrefix:p==null?void 0:p.breadcrumbsPrefix}),json:(s,p)=>Ph({value:s,discriminant:t,transformedDiscriminant:e,transformDiscriminantValue:l=>{var c;return i.json(l,{allowUnrecognizedEnumValues:p==null?void 0:p.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(c=p==null?void 0:p.breadcrumbsPrefix)!=null?c:[],t]})},getAdditionalPropertiesSchema:l=>o[l],allowUnrecognizedUnionMembers:p==null?void 0:p.allowUnrecognizedUnionMembers,transformAdditionalProperties:(l,c)=>c.json(l,p),breadcrumbsPrefix:p==null?void 0:p.breadcrumbsPrefix}),getType:()=>N.UNION};return {...te(a),...J(a),...Pe(a)}}function Ph({value:n,discriminant:o,transformedDiscriminant:e,transformDiscriminantValue:t,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:a=false,transformAdditionalProperties:s,breadcrumbsPrefix:p=[]}){if(!Ie(n))return {ok:false,errors:[{path:p,message:L(n,"object")}]};let{[o]:l,...c}=n;if(l==null)return {ok:false,errors:[{path:p,message:`Missing discriminant ("${o}")`}]};let d=t(l);if(!d.ok)return {ok:false,errors:d.errors};let m=i(d.value);if(m==null)return a?{ok:true,value:{[e]:d.value,...c}}:{ok:false,errors:[{path:[...p,o],message:"Unexpected discriminant value"}]};let f=s(c,m);return f.ok?{ok:true,value:{[e]:l,...f.value}}:f}var R={};W(R,{encodePathParam:()=>Th,join:()=>jh,toQueryString:()=>rr});function Th(n){if(n===null)return "null";switch(typeof n){case "undefined":return "undefined";case "string":case "number":case "boolean":break;default:n=String(n);break}return encodeURIComponent(n)}function jh(n,...o){if(!n)return "";if(o.length===0)return n;if(n.includes("://")){let e;try{e=new URL(n);}catch{return vh(n,...o)}let t=o[o.length-1],i=t==null?void 0:t.endsWith("/");for(let a of o){let s=Ch(a);s&&(e.pathname=Eh(e.pathname,s));}return i&&!e.pathname.endsWith("/")&&(e.pathname+="/"),e.toString()}return vh(n,...o)}function vh(n,...o){if(o.length===0)return n;let e=n,t=o[o.length-1],i=t==null?void 0:t.endsWith("/");for(let a of o){let s=Ch(a);s&&(e=Eh(e,s));}return i&&!e.endsWith("/")&&(e+="/"),e}function Eh(n,o){return n.endsWith("/")?n+o:`${n}/${o}`}function Ch(n){if(!n)return n;let o=0,e=n.length;return n.startsWith("/")&&(o=1),n.endsWith("/")&&(e=n.length-1),o===0&&e===n.length?n:n.slice(o,e)}function F(n){let o=z({"X-Fern-Language":"JavaScript","X-Fern-Runtime":Ar.type,"X-Fern-Runtime-Version":Ar.version,"Comet-Workspace":n==null?void 0:n.workspaceName},n==null?void 0:n.headers);return {...n,logging:ot.createLogger(n==null?void 0:n.logging),headers:o}}var S={Default:"http://localhost:5173/api"};function A(n,o,e,t){switch(n.reason){case "non-json":throw new w({statusCode:n.statusCode,body:n.rawBody,rawResponse:o});case "body-is-null":throw new w({statusCode:n.statusCode,rawResponse:o});case "timeout":throw new Sr(`Timeout exceeded when calling ${e} ${t}.`);case "unknown":throw new w({message:n.errorMessage,rawResponse:o});default:throw new w({message:"Unknown error",rawResponse:o})}}var H={};W(H,{AggregationData:()=>gp,Alert:()=>vx,AlertAlertType:()=>yp,AlertPagePublic:()=>vp,AlertPublic:()=>wo,AlertPublicAlertType:()=>zp,AlertTrigger:()=>wp,AlertTriggerConfig:()=>xp,AlertTriggerConfigPublic:()=>Sp,AlertTriggerConfigPublicType:()=>kp,AlertTriggerConfigType:()=>bp,AlertTriggerConfigWrite:()=>Ep,AlertTriggerConfigWriteType:()=>jp,AlertTriggerEventType:()=>Rp,AlertTriggerPublic:()=>Ap,AlertTriggerPublicEventType:()=>Pp,AlertTriggerWrite:()=>Ip,AlertTriggerWriteEventType:()=>Cp,AlertWrite:()=>_o,AlertWriteAlertType:()=>Dp,AnnotationQueue:()=>Mp,AnnotationQueueBatch:()=>jx,AnnotationQueueBatchWrite:()=>pt,AnnotationQueueItemIds:()=>Da,AnnotationQueuePagePublic:()=>Vp,AnnotationQueuePublic:()=>zo,AnnotationQueuePublicScope:()=>Wp,AnnotationQueueReviewer:()=>Fp,AnnotationQueueReviewerPublic:()=>Bp,AnnotationQueueScope:()=>Np,AnnotationQueueUpdate:()=>ct,AnnotationQueueWrite:()=>st,AnnotationQueueWriteScope:()=>Ps,AssistantMessage:()=>Jp,AssistantMessageRole:()=>Lp,Attachment:()=>Gp,AttachmentListRequestEntityType:()=>Oi,AttachmentPage:()=>Kp,AudioUrl:()=>$p,AudioUrlPublic:()=>Qp,AudioUrlWrite:()=>Yp,AuthDetailsHolder:()=>Xp,AutomationRuleEvaluator:()=>Ex,AutomationRuleEvaluatorAction:()=>Zp,AutomationRuleEvaluatorLlmAsJudge:()=>ic,AutomationRuleEvaluatorLlmAsJudgePublic:()=>Eo,AutomationRuleEvaluatorLlmAsJudgeWrite:()=>Sc,AutomationRuleEvaluatorObjectObjectPublic:()=>Cc,AutomationRuleEvaluatorObjectObjectPublicAction:()=>Pc,AutomationRuleEvaluatorPagePublic:()=>Ic,AutomationRuleEvaluatorPublic:()=>Uc,AutomationRuleEvaluatorPublicAction:()=>Dc,AutomationRuleEvaluatorSpanLlmAsJudge:()=>nc,AutomationRuleEvaluatorSpanLlmAsJudgePublic:()=>Io,AutomationRuleEvaluatorSpanLlmAsJudgeWrite:()=>Mc,AutomationRuleEvaluatorSpanUserDefinedMetricPython:()=>sc,AutomationRuleEvaluatorSpanUserDefinedMetricPythonPublic:()=>Do,AutomationRuleEvaluatorSpanUserDefinedMetricPythonWrite:()=>Bc,AutomationRuleEvaluatorTraceThreadLlmAsJudge:()=>pc,AutomationRuleEvaluatorTraceThreadLlmAsJudgePublic:()=>Uo,AutomationRuleEvaluatorTraceThreadLlmAsJudgeWrite:()=>Hc,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPython:()=>cc,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonPublic:()=>Fo,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonWrite:()=>Gc,AutomationRuleEvaluatorUpdate:()=>qc,AutomationRuleEvaluatorUpdateAction:()=>Kc,AutomationRuleEvaluatorUpdateLlmAsJudge:()=>$c,AutomationRuleEvaluatorUpdateSpanLlmAsJudge:()=>Qc,AutomationRuleEvaluatorUpdateSpanUserDefinedMetricPython:()=>Yc,AutomationRuleEvaluatorUpdateTraceThreadLlmAsJudge:()=>Xc,AutomationRuleEvaluatorUpdateTraceThreadUserDefinedMetricPython:()=>Zc,AutomationRuleEvaluatorUpdateUserDefinedMetricPython:()=>Oc,AutomationRuleEvaluatorUserDefinedMetricPython:()=>lc,AutomationRuleEvaluatorUserDefinedMetricPythonPublic:()=>No,AutomationRuleEvaluatorUserDefinedMetricPythonWrite:()=>rl,AutomationRuleEvaluatorWrite:()=>ol,AutomationRuleEvaluatorWriteAction:()=>tl,AvgValueStatPublic:()=>il,BatchDelete:()=>Y,BatchDeleteByProject:()=>Cx,BiInformation:()=>al,BiInformationResponse:()=>Vr,BooleanFeedbackDefinition:()=>sl,BooleanFeedbackDefinitionCreate:()=>cl,BooleanFeedbackDefinitionPublic:()=>Vo,BooleanFeedbackDefinitionUpdate:()=>dl,BooleanFeedbackDetail:()=>nl,BooleanFeedbackDetailCreate:()=>pl,BooleanFeedbackDetailPublic:()=>ll,BooleanFeedbackDetailUpdate:()=>ml,CategoricalFeedbackDefinition:()=>fl,CategoricalFeedbackDefinitionCreate:()=>gl,CategoricalFeedbackDefinitionPublic:()=>Lo,CategoricalFeedbackDefinitionUpdate:()=>xl,CategoricalFeedbackDetail:()=>ul,CategoricalFeedbackDetailCreate:()=>hl,CategoricalFeedbackDetailPublic:()=>yl,CategoricalFeedbackDetailUpdate:()=>bl,ChatCompletionChoice:()=>wl,ChatCompletionRequest:()=>dt,ChatCompletionResponse:()=>Sl,Check:()=>Tl,CheckName:()=>Pl,CheckPublic:()=>El,CheckPublicName:()=>vl,CheckPublicResult:()=>jl,CheckResult:()=>Al,ChunkedOutputJsonNode:()=>Ix,ChunkedOutputJsonNodePublic:()=>Dx,ChunkedOutputJsonNodePublicType:()=>Il,ChunkedOutputJsonNodeType:()=>Cl,Column:()=>Ul,ColumnCompare:()=>Nl,ColumnCompareTypesItem:()=>Fl,ColumnPublic:()=>Wl,ColumnPublicTypesItem:()=>Ml,ColumnTypesItem:()=>Dl,Comment:()=>O,CommentCompare:()=>Bl,CommentPublic:()=>gr,CompleteMultipartUploadRequest:()=>Ua,CompleteMultipartUploadRequestEntityType:()=>Vl,CompletionTokensDetails:()=>_l,CountValueStatPublic:()=>Hl,CreateDatasetItemsFromSpansRequest:()=>ht,CreateDatasetItemsFromTracesRequest:()=>gt,CreatePromptVersionDetail:()=>Xt,CreatePromptVersionDetailTemplateStructure:()=>_a,DashboardPagePublic:()=>Jl,DashboardPublic:()=>yr,DashboardUpdatePublic:()=>ut,DashboardWrite:()=>ft,DataPointDouble:()=>Ux,DataPointNumberPublic:()=>Gl,Dataset:()=>Fx,DatasetExpansion:()=>Nx,DatasetExpansionResponse:()=>Yl,DatasetExpansionWrite:()=>yt,DatasetExportJobPublic:()=>Cr,DatasetExportJobPublicStatus:()=>Ws,DatasetIdentifier:()=>bt,DatasetIdentifierPublic:()=>xt,DatasetItem:()=>Jo,DatasetItemBatch:()=>Mx,DatasetItemBatchUpdate:()=>wt,DatasetItemBatchWrite:()=>zt,DatasetItemChangesPublic:()=>Xl,DatasetItemCompare:()=>im,DatasetItemCompareSource:()=>Zl,DatasetItemFilter:()=>Rt,DatasetItemFilterOperator:()=>Fs,DatasetItemPageCompare:()=>am,DatasetItemPagePublic:()=>pm,DatasetItemPublic:()=>Ko,DatasetItemPublicSource:()=>nm,DatasetItemSource:()=>Ql,DatasetItemStreamRequest:()=>kt,DatasetItemUpdate:()=>Ns,DatasetItemWrite:()=>_t,DatasetItemWriteSource:()=>Ms,DatasetItemsDelete:()=>St,DatasetPagePublic:()=>mm,DatasetPublic:()=>Lr,DatasetPublicStatus:()=>cm,DatasetPublicVisibility:()=>lm,DatasetStatus:()=>Kl,DatasetUpdate:()=>Pt,DatasetUpdateVisibility:()=>oa,DatasetVersionDiff:()=>um,DatasetVersionDiffStats:()=>dm,DatasetVersionPagePublic:()=>fm,DatasetVersionPublic:()=>br,DatasetVersionRestorePublic:()=>At,DatasetVersionSummary:()=>Ho,DatasetVersionSummaryPublic:()=>$o,DatasetVersionTag:()=>Tt,DatasetVersionUpdatePublic:()=>vt,DatasetVisibility:()=>$l,DatasetWrite:()=>jt,DatasetWriteVisibility:()=>ia,DeleteAttachmentsRequest:()=>Wx,DeleteAttachmentsRequestEntityType:()=>hm,DeleteFeedbackScore:()=>Qo,DeleteIdsHolder:()=>Hr,DeleteThreadFeedbackScores:()=>so,DeleteTraceThreads:()=>po,Delta:()=>Rl,DownloadAttachmentRequestEntityType:()=>qi,ErrorCountWithDeviation:()=>Yo,ErrorCountWithDeviationDetailed:()=>gm,ErrorInfo:()=>Ne,ErrorInfoExperimentItemBulkWriteView:()=>Dt,ErrorInfoPublic:()=>Xo,ErrorInfoWrite:()=>oo,ErrorMessage:()=>de,ErrorMessageDetail:()=>Bx,ErrorMessageDetailed:()=>Vx,ErrorMessagePublic:()=>Lx,Experiment:()=>Hx,ExperimentBatchUpdate:()=>It,ExperimentGroupAggregationsResponse:()=>Rm,ExperimentGroupResponse:()=>km,ExperimentItem:()=>Nt,ExperimentItemBulkRecord:()=>Tm,ExperimentItemBulkRecordExperimentItemBulkWriteView:()=>Ys,ExperimentItemBulkUpload:()=>Jx,ExperimentItemBulkUploadExperimentItemBulkWriteView:()=>Ut,ExperimentItemCompare:()=>om,ExperimentItemCompareTraceVisibilityMode:()=>Ol,ExperimentItemPublic:()=>Go,ExperimentItemPublicTraceVisibilityMode:()=>sm,ExperimentItemStreamRequest:()=>Ft,ExperimentItemTraceVisibilityMode:()=>Xs,ExperimentItemsBatch:()=>Mt,ExperimentItemsDelete:()=>Wt,ExperimentPagePublic:()=>Cm,ExperimentPublic:()=>ei,ExperimentPublicStatus:()=>vm,ExperimentPublicType:()=>jm,ExperimentScore:()=>Et,ExperimentScorePublic:()=>Em,ExperimentScoreWrite:()=>ep,ExperimentStatus:()=>ym,ExperimentStreamRequestPublic:()=>Bt,ExperimentType:()=>bm,ExperimentUpdate:()=>Ct,ExperimentUpdateStatus:()=>Bs,ExperimentUpdateType:()=>Vs,ExperimentWrite:()=>Vt,ExperimentWriteStatus:()=>sa,ExperimentWriteType:()=>pa,ExportTraceServiceRequest:()=>Gx,Feedback:()=>Kx,FeedbackCreate:()=>Wm,FeedbackDefinitionPagePublic:()=>Hm,FeedbackObjectPublic:()=>Lm,FeedbackPublic:()=>Gm,FeedbackScore:()=>se,FeedbackScoreAverage:()=>me,FeedbackScoreAverageDetailed:()=>Km,FeedbackScoreAveragePublic:()=>nr,FeedbackScoreBatch:()=>ti,FeedbackScoreBatchItem:()=>Qm,FeedbackScoreBatchItemSource:()=>$m,FeedbackScoreBatchItemThread:()=>fp,FeedbackScoreBatchItemThreadSource:()=>up,FeedbackScoreBatchThread:()=>co,FeedbackScoreCompare:()=>tm,FeedbackScoreCompareSource:()=>ql,FeedbackScoreExperimentItemBulkWriteView:()=>Gs,FeedbackScoreExperimentItemBulkWriteViewSource:()=>Ls,FeedbackScoreNames:()=>Xm,FeedbackScorePublic:()=>Jr,FeedbackScorePublicSource:()=>Zm,FeedbackScoreSource:()=>Zs,FeedbackUpdate:()=>od,FindFeedbackDefinitionsRequestType:()=>la,FindFeedbackScoreNames1RequestType:()=>Ta,Function:()=>mt,FunctionCall:()=>De,GetSpanStatsRequestType:()=>va,GetSpansByProjectRequestType:()=>ja,GetWebhookExamplesRequestAlertType:()=>$i,GroupContent:()=>wm,GroupContentWithAggregations:()=>xm,GroupDetail:()=>_m,GroupDetails:()=>zm,Guardrail:()=>nd,GuardrailBatch:()=>$x,GuardrailBatchWrite:()=>Lt,GuardrailName:()=>id,GuardrailResult:()=>ad,GuardrailWrite:()=>op,GuardrailWriteName:()=>rp,GuardrailWriteResult:()=>tp,GuardrailsValidation:()=>Pm,GuardrailsValidationPublic:()=>sd,IdsHolder:()=>Qx,ImageUrl:()=>Op,ImageUrlPublic:()=>dc,ImageUrlWrite:()=>bc,JsonListString:()=>K,JsonListStringCompare:()=>Fa,JsonListStringExperimentItemBulkWriteView:()=>Ae,JsonListStringPublic:()=>ye,JsonListStringWrite:()=>ge,JsonNode:()=>B,JsonNodeDetail:()=>sp,JsonNodePublic:()=>pe,JsonNodeWrite:()=>he,JsonSchema:()=>Ts,LlmAsJudgeCode:()=>So,LlmAsJudgeCodePublic:()=>yc,LlmAsJudgeCodeWrite:()=>zc,LlmAsJudgeMessage:()=>sr,LlmAsJudgeMessageContent:()=>ec,LlmAsJudgeMessageContentPublic:()=>fc,LlmAsJudgeMessageContentWrite:()=>Rc,LlmAsJudgeMessagePublic:()=>lr,LlmAsJudgeMessagePublicRole:()=>hc,LlmAsJudgeMessageRole:()=>rc,LlmAsJudgeMessageWrite:()=>ur,LlmAsJudgeMessageWriteRole:()=>wc,LlmAsJudgeModelParameters:()=>pr,LlmAsJudgeModelParametersPublic:()=>mr,LlmAsJudgeModelParametersWrite:()=>fr,LlmAsJudgeOutputSchema:()=>cr,LlmAsJudgeOutputSchemaPublic:()=>dr,LlmAsJudgeOutputSchemaPublicType:()=>gc,LlmAsJudgeOutputSchemaType:()=>tc,LlmAsJudgeOutputSchemaWrite:()=>hr,LlmAsJudgeOutputSchemaWriteType:()=>_c,LogItem:()=>cd,LogItemLevel:()=>pd,LogPage:()=>ld,ManualEvaluationRequest:()=>oi,ManualEvaluationRequestEntityType:()=>md,ManualEvaluationResponse:()=>ii,Message:()=>As,MultipartUploadPart:()=>Ll,NumericalFeedbackDefinition:()=>Dm,NumericalFeedbackDefinitionCreate:()=>Nm,NumericalFeedbackDefinitionPublic:()=>ri,NumericalFeedbackDefinitionUpdate:()=>rd,NumericalFeedbackDetail:()=>Im,NumericalFeedbackDetailCreate:()=>Fm,NumericalFeedbackDetailPublic:()=>Bm,NumericalFeedbackDetailUpdate:()=>ed,Optimization:()=>Yx,OptimizationPagePublic:()=>Td,OptimizationPublic:()=>ai,OptimizationPublicStatus:()=>Rd,OptimizationStatus:()=>dd,OptimizationStudioConfig:()=>xd,OptimizationStudioConfigPublic:()=>Ad,OptimizationStudioConfigWrite:()=>Ud,OptimizationStudioLog:()=>Fd,OptimizationUpdate:()=>Gt,OptimizationUpdateStatus:()=>ha,OptimizationWrite:()=>Wa,OptimizationWriteStatus:()=>Nd,PageColumns:()=>Md,PercentageValueStatPublic:()=>Wd,PercentageValues:()=>Me,PercentageValuesDetailed:()=>Bd,PercentageValuesPublic:()=>qo,Project:()=>Xx,ProjectDetailed:()=>Hd,ProjectDetailedVisibility:()=>Ld,ProjectMetricRequestPublic:()=>Kt,ProjectMetricRequestPublicInterval:()=>ya,ProjectMetricRequestPublicMetricType:()=>ba,ProjectMetricResponsePublic:()=>$d,ProjectMetricResponsePublicInterval:()=>Jd,ProjectMetricResponsePublicMetricType:()=>Gd,ProjectPagePublic:()=>Yd,ProjectPublic:()=>ni,ProjectPublicVisibility:()=>Qd,ProjectReference:()=>mc,ProjectReferencePublic:()=>Mo,ProjectRetrieveDetailed:()=>$t,ProjectStatItemObjectPublic:()=>Zd,ProjectStatsPublic:()=>Je,ProjectStatsSummary:()=>qd,ProjectStatsSummaryItem:()=>Od,ProjectUpdate:()=>Qt,ProjectUpdateVisibility:()=>xa,ProjectVisibility:()=>Vd,ProjectWrite:()=>Yt,ProjectWriteVisibility:()=>Ra,Prompt:()=>Zx,PromptDetail:()=>nu,PromptDetailTemplateStructure:()=>au,PromptPagePublic:()=>cu,PromptPublic:()=>pu,PromptPublicTemplateStructure:()=>su,PromptTemplateStructure:()=>eu,PromptTokensDetails:()=>zl,PromptType:()=>ru,PromptUpdatable:()=>Zt,PromptVersion:()=>iu,PromptVersionBatchUpdate:()=>Ot,PromptVersionDetail:()=>Ee,PromptVersionDetailTemplateStructure:()=>pp,PromptVersionDetailType:()=>cp,PromptVersionLink:()=>Na,PromptVersionLinkPublic:()=>Ma,PromptVersionLinkWrite:()=>na,PromptVersionPagePublic:()=>uu,PromptVersionPublic:()=>du,PromptVersionPublicTemplateStructure:()=>lu,PromptVersionPublicType:()=>mu,PromptVersionRetrieveDetail:()=>qt,PromptVersionTemplateStructure:()=>tu,PromptVersionType:()=>ou,PromptVersionUpdate:()=>lp,PromptWrite:()=>eo,PromptWriteTemplateStructure:()=>za,PromptWriteType:()=>ka,ProviderApiKey:()=>Ox,ProviderApiKeyPagePublic:()=>gu,ProviderApiKeyProvider:()=>fu,ProviderApiKeyPublic:()=>si,ProviderApiKeyPublicProvider:()=>hu,ProviderApiKeyUpdate:()=>Ht,ProviderApiKeyWrite:()=>Jt,ProviderApiKeyWriteProvider:()=>ua,ResponseFormat:()=>js,ResponseFormatType:()=>vs,Result:()=>xr,ResultsNumberPublic:()=>Kd,ScoreName:()=>Ym,ServiceTogglesConfig:()=>yu,Span:()=>Zo,SpanBatch:()=>qx,SpanBatchUpdate:()=>to,SpanBatchWrite:()=>ao,SpanEnrichmentOptions:()=>Ds,SpanExperimentItemBulkWriteView:()=>$s,SpanExperimentItemBulkWriteViewType:()=>Ks,SpanFilter:()=>Be,SpanFilterOperator:()=>ac,SpanFilterPublic:()=>Ue,SpanFilterPublicOperator:()=>ip,SpanFilterWrite:()=>Wo,SpanFilterWriteOperator:()=>Fc,SpanLlmAsJudgeCode:()=>Po,SpanLlmAsJudgeCodePublic:()=>Ac,SpanLlmAsJudgeCodeWrite:()=>Nc,SpanPagePublic:()=>xu,SpanPublic:()=>pi,SpanPublicType:()=>bu,SpanSearchStreamRequestPublic:()=>no,SpanSearchStreamRequestPublicType:()=>Pa,SpanType:()=>Sm,SpanUpdate:()=>ro,SpanUpdateType:()=>mp,SpanUserDefinedMetricPythonCode:()=>Ao,SpanUserDefinedMetricPythonCodePublic:()=>Tc,SpanUserDefinedMetricPythonCodeWrite:()=>Wc,SpanWrite:()=>io,SpanWriteType:()=>dp,SpansCountResponse:()=>wu,StartMultipartUploadRequest:()=>lt,StartMultipartUploadRequestEntityType:()=>Xi,StartMultipartUploadResponse:()=>_u,StreamOptions:()=>Es,StudioEvaluation:()=>fd,StudioEvaluationPublic:()=>_d,StudioEvaluationWrite:()=>jd,StudioLlmModel:()=>hd,StudioLlmModelPublic:()=>zd,StudioLlmModelWrite:()=>Ed,StudioMessage:()=>yd,StudioMessagePublic:()=>Sd,StudioMessageWrite:()=>Id,StudioMetric:()=>ud,StudioMetricPublic:()=>wd,StudioMetricWrite:()=>vd,StudioOptimizer:()=>gd,StudioOptimizerPublic:()=>kd,StudioOptimizerWrite:()=>Cd,StudioPrompt:()=>bd,StudioPromptPublic:()=>Pd,StudioPromptWrite:()=>Dd,Tool:()=>Is,ToolCall:()=>ko,ToolCallType:()=>Hp,ToolType:()=>Cs,Trace:()=>Oo,TraceBatch:()=>eR,TraceBatchUpdate:()=>mo,TraceBatchWrite:()=>fo,TraceCountResponse:()=>ku,TraceEnrichmentOptions:()=>Us,TraceExperimentItemBulkWriteView:()=>Qs,TraceFilter:()=>We,TraceFilterOperator:()=>oc,TraceFilterPublic:()=>Fe,TraceFilterPublicOperator:()=>ap,TraceFilterWrite:()=>Co,TraceFilterWriteOperator:()=>kc,TracePagePublic:()=>Pu,TracePublic:()=>ci,TracePublicVisibilityMode:()=>Su,TraceSearchStreamRequestPublic:()=>ho,TraceThread:()=>li,TraceThreadBatchIdentifier:()=>go,TraceThreadBatchUpdate:()=>bo,TraceThreadFilter:()=>Te,TraceThreadFilterOperator:()=>hp,TraceThreadFilterPublic:()=>ir,TraceThreadFilterPublicOperator:()=>np,TraceThreadFilterWrite:()=>Bo,TraceThreadFilterWriteOperator:()=>Vc,TraceThreadIdentifier:()=>Ba,TraceThreadLlmAsJudgeCode:()=>To,TraceThreadLlmAsJudgeCodePublic:()=>vc,TraceThreadLlmAsJudgeCodeWrite:()=>Lc,TraceThreadPage:()=>Tu,TraceThreadSearchStreamRequest:()=>xo,TraceThreadStatus:()=>Au,TraceThreadUpdate:()=>yo,TraceThreadUserDefinedMetricPythonCode:()=>vo,TraceThreadUserDefinedMetricPythonCodePublic:()=>jc,TraceThreadUserDefinedMetricPythonCodeWrite:()=>Jc,TraceUpdate:()=>lo,TraceVisibilityMode:()=>Am,TraceWrite:()=>uo,UploadAttachmentRequestEntityType:()=>ea,Usage:()=>kl,UserDefinedMetricPythonCode:()=>jo,UserDefinedMetricPythonCodePublic:()=>Ec,UserDefinedMetricPythonCodeWrite:()=>el,ValueEntry:()=>qs,ValueEntryCompare:()=>rm,ValueEntryCompareSource:()=>em,ValueEntryExperimentItemBulkWriteView:()=>Js,ValueEntryExperimentItemBulkWriteViewSource:()=>Hs,ValueEntryPublic:()=>qm,ValueEntryPublicSource:()=>Om,ValueEntrySource:()=>Os,VideoUrl:()=>qp,VideoUrlPublic:()=>uc,VideoUrlWrite:()=>xc,Webhook:()=>_p,WebhookExamples:()=>vu,WebhookPublic:()=>Tp,WebhookTestResult:()=>Eu,WebhookTestResultStatus:()=>ju,WebhookWrite:()=>Up,WelcomeWizardSubmission:()=>Ro,WelcomeWizardTracking:()=>Cu,WorkspaceConfiguration:()=>mi,WorkspaceMetricRequest:()=>rR,WorkspaceMetricResponse:()=>Va,WorkspaceMetricsSummaryRequest:()=>Gr,WorkspaceMetricsSummaryResponse:()=>Iu,WorkspaceNameHolder:()=>Du,WorkspaceSpansCount:()=>Ru,WorkspaceTraceCount:()=>zu,alerts:()=>Qi,annotationQueues:()=>Yi,attachments:()=>Er,chatCompletions:()=>ra,dashboards:()=>ta,datasets:()=>Ir,experiments:()=>Dr,feedbackDefinitions:()=>ma,guardrails:()=>da,llmProviderKey:()=>fa,optimizations:()=>ga,projects:()=>wa,prompts:()=>Sa,spans:()=>Ur,traces:()=>ar,welcomeWizard:()=>Ia});var Qi={};W(Qi,{GetWebhookExamplesRequestAlertType:()=>$i});var $i=r.enum_(["general","slack","pagerduty"]);var Ps=r.enum_(["trace","thread"]);var st=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:Ps,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional())});var pt=r.object({annotationQueues:r.property("annotation_queues",r.list(st))});var ct=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 Yi={};W(Yi,{AnnotationQueueBatchWrite:()=>pt,AnnotationQueueUpdate:()=>ct});var Xi=r.enum_(["trace","span"]);var lt=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",Xi),entityId:r.property("entity_id",r.string()),path:r.string()});var Er={};W(Er,{AttachmentListRequestEntityType:()=>Oi,DownloadAttachmentRequestEntityType:()=>qi,StartMultipartUploadRequest:()=>lt,StartMultipartUploadRequestEntityType:()=>Xi,UploadAttachmentRequestEntityType:()=>ea,uploadAttachment:()=>Zi});var Zi={};W(Zi,{Request:()=>zx});var zx=r.record(r.string(),r.unknown());var Oi=r.enum_(["trace","span"]);var qi=r.enum_(["trace","span"]);var ea=r.enum_(["trace","span"]);var mt=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 De=r.object({name:r.string().optional(),arguments:r.string().optional()});var As=r.record(r.string(),r.unknown());var Ts=r.object({name:r.string().optional(),strict:r.boolean().optional(),schema:r.record(r.string(),r.record(r.string(),r.unknown())).optional()});var vs=r.enum_(["text","json_object","json_schema"]);var js=r.object({type:vs.optional(),jsonSchema:r.property("json_schema",Ts.optional())});var Es=r.object({includeUsage:r.property("include_usage",r.boolean().optional())});var Cs=r.enum_(["function"]);var Is=r.object({type:Cs.optional(),function:mt.optional()});var dt=r.object({model:r.string().optional(),messages:r.list(As).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",Es.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",js.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(mt).optional(),functionCall:r.property("function_call",De.optional())});var ra={};W(ra,{ChatCompletionRequest:()=>dt});var pe=r.record(r.string(),r.unknown());var ut=r.object({name:r.string().optional(),description:r.string().optional(),config:pe.optional()});var he=r.record(r.string(),r.unknown());var ft=r.object({name:r.string(),description:r.string().optional(),config:he});var ta={};W(ta,{DashboardUpdatePublic:()=>ut,DashboardWrite:()=>ft});var Ds=r.object({includeTags:r.boolean().optional(),includeFeedbackScores:r.boolean().optional(),includeComments:r.boolean().optional(),includeUsage:r.boolean().optional(),includeMetadata:r.boolean().optional()});var ht=r.object({spanIds:r.property("span_ids",r.list(r.string())),enrichmentOptions:r.property("enrichment_options",Ds)});var Us=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 gt=r.object({traceIds:r.property("trace_ids",r.list(r.string())),enrichmentOptions:r.property("enrichment_options",Us)});var yt=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 bt=r.object({datasetName:r.property("dataset_name",r.string())});var xt=r.object({datasetName:r.property("dataset_name",r.string())});var Fs=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Rt=r.object({field:r.string().optional(),operator:Fs.optional(),key:r.string().optional(),value:r.string().optional()});var B=r.record(r.string(),r.unknown());var Ns=r.object({input:r.string().optional(),expectedOutput:r.property("expected_output",r.string().optional()),metadata:B.optional(),data:B.optional(),tags:r.list(r.string()).optional()});var wt=r.object({ids:r.list(r.string()).optional(),filters:r.list(Rt).optional(),datasetId:r.property("dataset_id",r.string().optional()),update:Ns,mergeTags:r.property("merge_tags",r.boolean().optional())});var Ms=r.enum_(["manual","trace","span","sdk"]);var _t=r.object({id:r.string().optional(),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Ms,data:B,tags:r.list(r.string()).optional()});var zt=r.object({datasetName:r.property("dataset_name",r.string().optional()),datasetId:r.property("dataset_id",r.string().optional()),items:r.list(_t),batchGroupId:r.property("batch_group_id",r.string().optional())});var kt=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()),datasetVersion:r.property("dataset_version",r.string().optional())});var St=r.object({itemIds:r.property("item_ids",r.list(r.string()).optional()),datasetId:r.property("dataset_id",r.string().optional()),filters:r.list(Rt).optional(),batchGroupId:r.property("batch_group_id",r.string().optional())});var oa=r.enum_(["private","public"]);var Pt=r.object({name:r.string(),description:r.string().optional(),visibility:oa.optional(),tags:r.list(r.string()).optional()});var At=r.object({versionRef:r.property("version_ref",r.string())});var Tt=r.object({tag:r.string()});var vt=r.object({changeDescription:r.property("change_description",r.string().optional()),tagsToAdd:r.property("tags_to_add",r.list(r.string()).optional())});var ia=r.enum_(["private","public"]);var jt=r.object({id:r.string().optional(),name:r.string(),visibility:ia.optional(),tags:r.list(r.string()).optional(),description:r.string().optional()});var Ir={};W(Ir,{CreateDatasetItemsFromSpansRequest:()=>ht,CreateDatasetItemsFromTracesRequest:()=>gt,DatasetExpansionWrite:()=>yt,DatasetIdentifier:()=>bt,DatasetIdentifierPublic:()=>xt,DatasetItemBatchUpdate:()=>wt,DatasetItemBatchWrite:()=>zt,DatasetItemStreamRequest:()=>kt,DatasetItemsDelete:()=>St,DatasetUpdate:()=>Pt,DatasetUpdateVisibility:()=>oa,DatasetVersionRestorePublic:()=>At,DatasetVersionTag:()=>Tt,DatasetVersionUpdatePublic:()=>vt,DatasetWrite:()=>jt,DatasetWriteVisibility:()=>ia,getDatasetExportJobs:()=>aa});var aa={};W(aa,{Response:()=>kx});var Ws=r.enum_(["PENDING","PROCESSING","COMPLETED","FAILED"]);var Cr=r.object({id:r.string().optional(),datasetId:r.property("dataset_id",r.string().optional()),datasetName:r.property("dataset_name",r.string().optional()),status:Ws.optional(),filePath:r.property("file_path",r.string().optional()),errorMessage:r.property("error_message",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),expiresAt:r.property("expires_at",r.date().optional()),viewedAt:r.property("viewed_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var kx=r.list(Cr);var Et=r.object({name:r.string(),value:r.number()});var Bs=r.enum_(["running","completed","cancelled"]);var Vs=r.enum_(["regular","trial","mini-batch"]);var Ct=r.object({name:r.string().optional(),metadata:B.optional(),tags:r.list(r.string()).optional(),type:Vs.optional(),status:Bs.optional(),experimentScores:r.property("experiment_scores",r.list(Et).optional())});var It=r.object({ids:r.list(r.string()),update:Ct,mergeTags:r.property("merge_tags",r.boolean().optional())});var Ls=r.enum_(["ui","sdk","online_scoring"]);var Hs=r.enum_(["ui","sdk","online_scoring"]);var Js=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:Hs.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),spanType:r.property("span_type",r.string().optional()),spanId:r.property("span_id",r.string().optional())});var Gs=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:Ls,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(),Js).optional())});var Ae=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Dt=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var Ks=r.enum_(["general","tool","llm","guardrail"]);var $s=r.object({id:r.string().optional(),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:Ks.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:Ae.optional(),output:Ae.optional(),metadata:Ae.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()),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 Qs=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:Ae.optional(),output:Ae.optional(),metadata:Ae.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Dt.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),threadId:r.property("thread_id",r.string().optional())});var Ys=r.object({datasetItemId:r.property("dataset_item_id",r.string()),evaluateTaskResult:r.property("evaluate_task_result",Ae.optional()),trace:Qs.optional(),spans:r.list($s).optional(),feedbackScores:r.property("feedback_scores",r.list(Gs).optional())});var Ut=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(Ys)});var Ft=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 O=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 Xs=r.enum_(["default","hidden"]);var Zs=r.enum_(["ui","sdk","online_scoring"]);var Os=r.enum_(["ui","sdk","online_scoring"]);var qs=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()),spanType:r.property("span_type",r.string().optional()),spanId:r.property("span_id",r.string().optional())});var se=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:Zs,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(),qs).optional())});var K=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Nt=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:K.optional(),output:K.optional(),feedbackScores:r.property("feedback_scores",r.list(se).optional()),comments:r.list(O).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",Xs.optional())});var Mt=r.object({experimentItems:r.property("experiment_items",r.list(Nt))});var Wt=r.object({ids:r.list(r.string())});var Bt=r.object({name:r.string(),limit:r.number().optional(),lastRetrievedId:r.property("last_retrieved_id",r.string().optional())});var ep=r.object({name:r.string(),value:r.number()});var ge=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var na=r.object({id:r.string()});var sa=r.enum_(["running","completed","cancelled"]);var pa=r.enum_(["regular","trial","mini-batch"]);var Vt=r.object({id:r.string().optional(),datasetName:r.property("dataset_name",r.string()),name:r.string().optional(),metadata:ge.optional(),tags:r.list(r.string()).optional(),type:pa.optional(),optimizationId:r.property("optimization_id",r.string().optional()),status:sa.optional(),experimentScores:r.property("experiment_scores",r.list(ep).optional()),promptVersion:r.property("prompt_version",na.optional()),promptVersions:r.property("prompt_versions",r.list(na).optional()),datasetVersionId:r.property("dataset_version_id",r.string().optional())});var Dr={};W(Dr,{ExperimentBatchUpdate:()=>It,ExperimentItemBulkUploadExperimentItemBulkWriteView:()=>Ut,ExperimentItemStreamRequest:()=>Ft,ExperimentItemsBatch:()=>Mt,ExperimentItemsDelete:()=>Wt,ExperimentStreamRequestPublic:()=>Bt,ExperimentWrite:()=>Vt,ExperimentWriteStatus:()=>sa,ExperimentWriteType:()=>pa,findFeedbackScoreNames:()=>ca});var ca={};W(ca,{Response:()=>Sx});var Sx=r.list(r.string());var ma={};W(ma,{FindFeedbackDefinitionsRequestType:()=>la});var la=r.enum_(["numerical","categorical","boolean"]);var rp=r.enum_(["TOPIC","PII"]);var tp=r.enum_(["passed","failed"]);var op=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:rp,result:tp,config:B,details:B});var Lt=r.object({guardrails:r.list(op)});var da={};W(da,{GuardrailBatchWrite:()=>Lt});var Ht=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 ua=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","bedrock","custom-llm","opik-free"]);var Jt=r.object({provider:ua,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 fa={};W(fa,{ProviderApiKeyUpdate:()=>Ht,ProviderApiKeyWrite:()=>Jt,ProviderApiKeyWriteProvider:()=>ua});var ha=r.enum_(["running","completed","cancelled","initialized","error"]);var Gt=r.object({name:r.string().optional(),status:ha.optional()});var ga={};W(ga,{OptimizationUpdate:()=>Gt,OptimizationUpdateStatus:()=>ha});var ip=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Ue=r.object({field:r.string().optional(),operator:ip.optional(),key:r.string().optional(),value:r.string().optional()});var ap=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Fe=r.object({field:r.string().optional(),operator:ap.optional(),key:r.string().optional(),value:r.string().optional()});var np=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var ir=r.object({field:r.string().optional(),operator:np.optional(),key:r.string().optional(),value:r.string().optional()});var ya=r.enum_(["HOURLY","DAILY","WEEKLY"]);var ba=r.enum_(["FEEDBACK_SCORES","TRACE_COUNT","TOKEN_USAGE","DURATION","COST","GUARDRAILS_FAILED_COUNT","THREAD_COUNT","THREAD_DURATION","THREAD_FEEDBACK_SCORES","SPAN_FEEDBACK_SCORES","SPAN_COUNT","SPAN_DURATION","SPAN_TOKEN_USAGE"]);var Kt=r.object({metricType:r.property("metric_type",ba.optional()),interval:ya.optional(),intervalStart:r.property("interval_start",r.date().optional()),intervalEnd:r.property("interval_end",r.date().optional()),spanFilters:r.property("span_filters",r.list(Ue).optional()),traceFilters:r.property("trace_filters",r.list(Fe).optional()),threadFilters:r.property("thread_filters",r.list(ir).optional())});var $t=r.object({name:r.string()});var xa=r.enum_(["private","public"]);var Qt=r.object({name:r.string().optional(),description:r.string().optional(),visibility:xa.optional()});var Ra=r.enum_(["private","public"]);var Yt=r.object({name:r.string(),visibility:Ra.optional(),description:r.string().optional()});var wa={};W(wa,{ProjectMetricRequestPublic:()=>Kt,ProjectMetricRequestPublicInterval:()=>ya,ProjectMetricRequestPublicMetricType:()=>ba,ProjectRetrieveDetailed:()=>$t,ProjectUpdate:()=>Qt,ProjectUpdateVisibility:()=>xa,ProjectWrite:()=>Yt,ProjectWriteVisibility:()=>Ra});var sp=r.record(r.string(),r.unknown());var pp=r.enum_(["text","chat"]);var cp=r.enum_(["mustache","jinja2"]);var Ee=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:sp.optional(),type:cp.optional(),changeDescription:r.property("change_description",r.string().optional()),tags:r.list(r.string()).optional(),variables:r.list(r.string()).optional(),templateStructure:r.property("template_structure",pp.optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var _a=r.enum_(["text","chat"]);var Xt=r.object({name:r.string(),version:Ee,templateStructure:r.property("template_structure",_a.optional())});var Zt=r.object({name:r.string(),description:r.string().optional(),tags:r.list(r.string()).optional()});var lp=r.object({tags:r.list(r.string()).optional()});var Ot=r.object({ids:r.list(r.string()),update:lp,mergeTags:r.property("merge_tags",r.boolean().optional())});var qt=r.object({name:r.string(),commit:r.string().optional()});var za=r.enum_(["text","chat"]);var ka=r.enum_(["mustache","jinja2"]);var eo=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),template:r.string().optional(),metadata:he.optional(),changeDescription:r.property("change_description",r.string().optional()),type:ka.optional(),templateStructure:r.property("template_structure",za.optional()),tags:r.list(r.string()).optional()});var Sa={};W(Sa,{CreatePromptVersionDetail:()=>Xt,CreatePromptVersionDetailTemplateStructure:()=>_a,PromptUpdatable:()=>Zt,PromptVersionBatchUpdate:()=>Ot,PromptVersionRetrieveDetail:()=>qt,PromptWrite:()=>eo,PromptWriteTemplateStructure:()=>za,PromptWriteType:()=>ka});var Ne=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var mp=r.enum_(["general","tool","llm","guardrail"]);var ro=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:mp.optional(),endTime:r.property("end_time",r.date().optional()),input:K.optional(),output:K.optional(),metadata:K.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",Ne.optional())});var to=r.object({ids:r.list(r.string()),update:ro,mergeTags:r.property("merge_tags",r.boolean().optional())});var oo=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var dp=r.enum_(["general","tool","llm","guardrail"]);var io=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:dp.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:ge.optional(),output:ge.optional(),metadata:ge.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",oo.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 ao=r.object({spans:r.list(io)});var Pa=r.enum_(["general","tool","llm","guardrail"]);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:Pa.optional(),filters:r.list(Ue).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 Ur={};W(Ur,{FindFeedbackScoreNames1RequestType:()=>Ta,GetSpanStatsRequestType:()=>va,GetSpansByProjectRequestType:()=>ja,SpanBatchUpdate:()=>to,SpanBatchWrite:()=>ao,SpanSearchStreamRequestPublic:()=>no,SpanSearchStreamRequestPublicType:()=>Pa,findFeedbackScoreNames1:()=>Aa});var Aa={};W(Aa,{Response:()=>Px});var Px=r.list(r.string());var Ta=r.enum_(["general","tool","llm","guardrail"]);var va=r.enum_(["general","tool","llm","guardrail"]);var ja=r.enum_(["general","tool","llm","guardrail"]);var so=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 po=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 up=r.enum_(["ui","sdk","online_scoring"]);var fp=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:up,author:r.string().optional(),threadId:r.property("thread_id",r.string())});var co=r.object({scores:r.list(fp)});var lo=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:K.optional(),output:K.optional(),metadata:K.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Ne.optional()),threadId:r.property("thread_id",r.string().optional())});var mo=r.object({ids:r.list(r.string()),update:lo,mergeTags:r.property("merge_tags",r.boolean().optional())});var uo=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:ge.optional(),output:ge.optional(),metadata:ge.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",oo.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),threadId:r.property("thread_id",r.string().optional())});var fo=r.object({traces:r.list(uo)});var ho=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),filters:r.list(Fe).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 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 yo=r.object({tags:r.list(r.string()).optional()});var bo=r.object({ids:r.list(r.string()),update:yo,mergeTags:r.property("merge_tags",r.boolean().optional())});var hp=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Te=r.object({field:r.string().optional(),operator:hp.optional(),key:r.string().optional(),value:r.string().optional()});var xo=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),filters:r.list(Te).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 ar={};W(ar,{DeleteThreadFeedbackScores:()=>so,DeleteTraceThreads:()=>po,FeedbackScoreBatchThread:()=>co,TraceBatchUpdate:()=>mo,TraceBatchWrite:()=>fo,TraceSearchStreamRequestPublic:()=>ho,TraceThreadBatchIdentifier:()=>go,TraceThreadBatchUpdate:()=>bo,TraceThreadSearchStreamRequest:()=>xo,findFeedbackScoreNames2:()=>Ea,findTraceThreadsFeedbackScoreNames:()=>Ca});var Ea={};W(Ea,{Response:()=>Ax});var Ax=r.list(r.string());var Ca={};W(Ca,{Response:()=>Tx});var Tx=r.list(r.string());var Ro=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 Ia={};W(Ia,{WelcomeWizardSubmission:()=>Ro});var me=r.object({name:r.string(),value:r.number()});var Me=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var gp=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:Me.optional(),feedbackScores:r.property("feedback_scores",r.list(me).optional()),experimentScores:r.property("experiment_scores",r.list(me).optional())});var yp=r.enum_(["general","slack","pagerduty"]);var bp=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var xp=r.object({id:r.string().optional(),alertTriggerId:r.property("alert_trigger_id",r.string().optional()),type:bp,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 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 wp=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(xp).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var _p=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 vx=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",yp.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:_p,triggers:r.list(wp).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 zp=r.enum_(["general","slack","pagerduty"]);var kp=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var Sp=r.object({id:r.string().optional(),alertTriggerId:r.property("alert_trigger_id",r.string().optional()),type:kp,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 Pp=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 Ap=r.object({id:r.string().optional(),alertId:r.property("alert_id",r.string().optional()),eventType:r.property("event_type",Pp),triggerConfigs:r.property("trigger_configs",r.list(Sp).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Tp=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 wo=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",zp.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:Tp,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 vp=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(wo).optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var jp=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var Ep=r.object({id:r.string().optional(),type:jp,configValue:r.property("config_value",r.record(r.string(),r.string()).optional())});var Cp=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 Ip=r.object({id:r.string().optional(),eventType:r.property("event_type",Cp),triggerConfigs:r.property("trigger_configs",r.list(Ep).optional())});var Dp=r.enum_(["general","slack","pagerduty"]);var Up=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 _o=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",Dp.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:Up,triggers:r.list(Ip).optional()});var Fp=r.object({username:r.string().optional(),status:r.number().optional()});var Np=r.enum_(["trace","thread"]);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:Np,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional()),reviewers:r.list(Fp).optional(),feedbackScores:r.property("feedback_scores",r.list(me).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 jx=r.object({annotationQueues:r.property("annotation_queues",r.list(Mp))});var Da=r.object({ids:r.list(r.string())});var Wp=r.enum_(["trace","thread"]);var Bp=r.object({username:r.string().optional(),status:r.number().optional()});var nr=r.object({name:r.string(),value:r.number()});var zo=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:Wp,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional()),reviewers:r.list(Bp).optional(),feedbackScores:r.property("feedback_scores",r.list(nr).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 Vp=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(zo).optional(),sortableBy:r.list(r.string()).optional()});var Lp=r.enum_(["system","user","assistant","tool","function"]);var Hp=r.enum_(["function"]);var ko=r.object({id:r.string().optional(),index:r.number().optional(),type:Hp.optional(),function:De.optional()});var Jp=r.object({role:Lp.optional(),content:r.string().optional(),reasoningContent:r.property("reasoning_content",r.string().optional()),name:r.string().optional(),toolCalls:r.property("tool_calls",r.list(ko).optional()),refusal:r.string().optional(),functionCall:r.property("function_call",De.optional())});var Gp=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 Kp=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Gp).optional(),sortableBy:r.list(r.string()).optional()});var $p=r.object({url:r.string()});var Qp=r.object({url:r.string()});var Yp=r.object({url:r.string()});var Xp=r.record(r.string(),r.unknown());var Zp=r.enum_(["evaluator"]);var Op=r.object({url:r.string(),detail:r.string().optional()});var qp=r.object({url:r.string()});var ec=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",Op.optional()),videoUrl:r.property("video_url",qp.optional()),audioUrl:r.property("audio_url",$p.optional())});var rc=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var sr=r.object({role:rc,content:r.string().optional(),contentArray:r.property("content_array",r.list(ec).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var pr=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",B.optional())});var tc=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var cr=r.object({name:r.string(),type:tc,description:r.string()});var So=r.object({model:pr,messages:r.list(sr),variables:r.record(r.string(),r.string()),schema:r.list(cr)});var oc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var We=r.object({field:r.string().optional(),operator:oc.optional(),key:r.string().optional(),value:r.string().optional()});var ic=r.object({filters:r.list(We).optional(),code:So.optional()});var ac=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Be=r.object({field:r.string().optional(),operator:ac.optional(),key:r.string().optional(),value:r.string().optional()});var Po=r.object({model:pr,messages:r.list(sr),variables:r.record(r.string(),r.string()),schema:r.list(cr)});var nc=r.object({filters:r.list(Be).optional(),code:Po.optional()});var Ao=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var sc=r.object({filters:r.list(Be).optional(),code:Ao.optional()});var To=r.object({model:pr,messages:r.list(sr),schema:r.list(cr)});var pc=r.object({filters:r.list(Te).optional(),code:To.optional()});var vo=r.object({metric:r.string()});var cc=r.object({filters:r.list(Te).optional(),code:vo.optional()});var jo=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var lc=r.object({filters:r.list(We).optional(),code:jo.optional()});var mc=r.object({projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string())});var Fr=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string().optional()),projectName:r.property("project_name",r.string().optional()),projects:r.list(mc).optional(),projectIds:r.property("project_ids",r.list(r.string()).optional()),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().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:Zp}),Ex=r.union("type",{llm_as_judge:ic.extend(Fr),user_defined_metric_python:lc.extend(Fr),trace_thread_llm_as_judge:pc.extend(Fr),trace_thread_user_defined_metric_python:cc.extend(Fr),span_llm_as_judge:nc.extend(Fr),span_user_defined_metric_python:sc.extend(Fr)}).transform({transform:n=>n,untransform:n=>n});var dc=r.object({url:r.string(),detail:r.string().optional()});var uc=r.object({url:r.string()});var fc=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",dc.optional()),videoUrl:r.property("video_url",uc.optional()),audioUrl:r.property("audio_url",Qp.optional())});var hc=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var lr=r.object({role:hc,content:r.string().optional(),contentArray:r.property("content_array",r.list(fc).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var mr=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",pe.optional())});var gc=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var dr=r.object({name:r.string(),type:gc,description:r.string()});var yc=r.object({model:mr,messages:r.list(lr),variables:r.record(r.string(),r.string()),schema:r.list(dr)});var Eo=r.object({filters:r.list(Fe).optional(),code:yc.optional()});var bc=r.object({url:r.string(),detail:r.string().optional()});var xc=r.object({url:r.string()});var Rc=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",bc.optional()),videoUrl:r.property("video_url",xc.optional()),audioUrl:r.property("audio_url",Yp.optional())});var wc=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var ur=r.object({role:wc,content:r.string().optional(),contentArray:r.property("content_array",r.list(Rc).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var fr=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",he.optional())});var _c=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var hr=r.object({name:r.string(),type:_c,description:r.string()});var zc=r.object({model:fr,messages:r.list(ur),variables:r.record(r.string(),r.string()),schema:r.list(hr)});var kc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Co=r.object({field:r.string().optional(),operator:kc.optional(),key:r.string().optional(),value:r.string().optional()});var Sc=r.object({filters:r.list(Co).optional(),code:zc.optional()});var Pc=r.enum_(["evaluator"]);var Ac=r.object({model:mr,messages:r.list(lr),variables:r.record(r.string(),r.string()),schema:r.list(dr)});var Io=r.object({filters:r.list(Ue).optional(),code:Ac.optional()});var Tc=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Do=r.object({filters:r.list(Ue).optional(),code:Tc.optional()});var vc=r.object({model:mr,messages:r.list(lr),schema:r.list(dr)});var Uo=r.object({filters:r.list(ir).optional(),code:vc.optional()});var jc=r.object({metric:r.string()});var Fo=r.object({filters:r.list(ir).optional(),code:jc.optional()});var Ec=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var No=r.object({filters:r.list(Fe).optional(),code:Ec.optional()});var Mo=r.object({projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string())});var Nr=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string().optional()),projectName:r.property("project_name",r.string().optional()),projects:r.list(Mo).optional(),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().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:Pc}),Cc=r.union("type",{llm_as_judge:Eo.extend(Nr),user_defined_metric_python:No.extend(Nr),trace_thread_llm_as_judge:Uo.extend(Nr),trace_thread_user_defined_metric_python:Fo.extend(Nr),span_llm_as_judge:Io.extend(Nr),span_user_defined_metric_python:Do.extend(Nr)}).transform({transform:n=>n,untransform:n=>n});var Ic=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Cc).optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var Dc=r.enum_(["evaluator"]);var Mr=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string().optional()),projectName:r.property("project_name",r.string().optional()),projects:r.list(Mo).optional(),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().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:Dc}),Uc=r.union("type",{llm_as_judge:Eo.extend(Mr),user_defined_metric_python:No.extend(Mr),trace_thread_llm_as_judge:Uo.extend(Mr),trace_thread_user_defined_metric_python:Fo.extend(Mr),span_llm_as_judge:Io.extend(Mr),span_user_defined_metric_python:Do.extend(Mr)}).transform({transform:n=>n,untransform:n=>n});var Fc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Wo=r.object({field:r.string().optional(),operator:Fc.optional(),key:r.string().optional(),value:r.string().optional()});var Nc=r.object({model:fr,messages:r.list(ur),variables:r.record(r.string(),r.string()),schema:r.list(hr)});var Mc=r.object({filters:r.list(Wo).optional(),code:Nc.optional()});var Wc=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Bc=r.object({filters:r.list(Wo).optional(),code:Wc.optional()});var Vc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Bo=r.object({field:r.string().optional(),operator:Vc.optional(),key:r.string().optional(),value:r.string().optional()});var Lc=r.object({model:fr,messages:r.list(ur),schema:r.list(hr)});var Hc=r.object({filters:r.list(Bo).optional(),code:Lc.optional()});var Jc=r.object({metric:r.string()});var Gc=r.object({filters:r.list(Bo).optional(),code:Jc.optional()});var Kc=r.enum_(["evaluator"]);var $c=r.object({filters:r.list(We).optional(),code:So.optional()});var Qc=r.object({filters:r.list(Be).optional(),code:Po.optional()});var Yc=r.object({filters:r.list(Be).optional(),code:Ao.optional()});var Xc=r.object({filters:r.list(Te).optional(),code:To.optional()});var Zc=r.object({filters:r.list(Te).optional(),code:vo.optional()});var Oc=r.object({filters:r.list(We).optional(),code:jo.optional()});var Wr=r.object({name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),projectId:r.property("project_id",r.string().optional()),projectIds:r.property("project_ids",r.list(r.string()).optional()),action:Kc}),qc=r.union("type",{llm_as_judge:$c.extend(Wr),user_defined_metric_python:Oc.extend(Wr),trace_thread_llm_as_judge:Xc.extend(Wr),trace_thread_user_defined_metric_python:Zc.extend(Wr),span_llm_as_judge:Qc.extend(Wr),span_user_defined_metric_python:Yc.extend(Wr)}).transform({transform:n=>n,untransform:n=>n});var el=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var rl=r.object({filters:r.list(Co).optional(),code:el.optional()});var tl=r.enum_(["evaluator"]);var Br=r.object({projectId:r.property("project_id",r.string().optional()),projectIds:r.property("project_ids",r.list(r.string()).optional()),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),action:tl}),ol=r.union("type",{llm_as_judge:Sc.extend(Br),user_defined_metric_python:rl.extend(Br),trace_thread_llm_as_judge:Hc.extend(Br),trace_thread_user_defined_metric_python:Gc.extend(Br),span_llm_as_judge:Mc.extend(Br),span_user_defined_metric_python:Bc.extend(Br)}).transform({transform:n=>n,untransform:n=>n});var il=r.object({value:r.number().optional()});var Y=r.object({ids:r.list(r.string())});var Cx=r.object({ids:r.list(r.string()),projectId:r.property("project_id",r.string().optional())});var al=r.object({workspaceId:r.property("workspace_id",r.string().optional()),user:r.string().optional(),count:r.number().optional()});var Vr=r.object({biInformation:r.property("bi_information",r.list(al).optional())});var nl=r.object({trueLabel:r.string(),falseLabel:r.string()});var sl=r.object({details:nl.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 pl=r.object({trueLabel:r.string(),falseLabel:r.string()});var cl=r.object({details:pl.optional()});var ll=r.object({trueLabel:r.string(),falseLabel:r.string()});var Vo=r.object({details:ll.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({trueLabel:r.string(),falseLabel:r.string()});var dl=r.object({details:ml.optional()});var ul=r.object({categories:r.record(r.string(),r.number())});var fl=r.object({details:ul.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 hl=r.object({categories:r.record(r.string(),r.number())});var gl=r.object({details:hl.optional()});var yl=r.object({categories:r.record(r.string(),r.number())});var Lo=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 bl=r.object({categories:r.record(r.string(),r.number())});var xl=r.object({details:bl.optional()});var Rl=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(ko).optional()),functionCall:r.property("function_call",De.optional())});var wl=r.object({index:r.number().optional(),message:Jp.optional(),delta:Rl.optional(),finishReason:r.property("finish_reason",r.string().optional())});var _l=r.object({reasoningTokens:r.property("reasoning_tokens",r.number().optional())});var zl=r.object({cachedTokens:r.property("cached_tokens",r.number().optional())});var kl=r.object({totalTokens:r.property("total_tokens",r.number().optional()),promptTokens:r.property("prompt_tokens",r.number().optional()),promptTokensDetails:r.property("prompt_tokens_details",zl.optional()),completionTokens:r.property("completion_tokens",r.number().optional()),completionTokensDetails:r.property("completion_tokens_details",_l.optional())});var Sl=r.object({id:r.string().optional(),created:r.number().optional(),model:r.string().optional(),choices:r.list(wl).optional(),usage:kl.optional(),systemFingerprint:r.property("system_fingerprint",r.string().optional()),serviceTier:r.property("service_tier",r.string().optional())});var Pl=r.enum_(["TOPIC","PII"]);var Al=r.enum_(["passed","failed"]);var Tl=r.object({name:Pl.optional(),result:Al.optional()});var vl=r.enum_(["TOPIC","PII"]);var jl=r.enum_(["passed","failed"]);var El=r.object({name:vl.optional(),result:jl.optional()});var Cl=r.object({typeName:r.string().optional()});var Ix=r.object({type:Cl.optional(),closed:r.boolean().optional()});var Il=r.object({typeName:r.string().optional()});var Dx=r.object({type:Il.optional(),closed:r.boolean().optional()});var Dl=r.enum_(["string","number","object","boolean","array","null"]);var Ul=r.object({name:r.string().optional(),types:r.list(Dl).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var Fl=r.enum_(["string","number","object","boolean","array","null"]);var Nl=r.object({name:r.string().optional(),types:r.list(Fl).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var Ml=r.enum_(["string","number","object","boolean","array","null"]);var Wl=r.object({name:r.string().optional(),types:r.list(Ml).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var Bl=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 gr=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 Vl=r.enum_(["trace","span"]);var Ll=r.object({eTag:r.property("e_tag",r.string()),partNumber:r.property("part_number",r.number())});var Ua=r.object({fileName:r.property("file_name",r.string()),projectName:r.property("project_name",r.string().optional()),entityType:r.property("entity_type",Vl),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(Ll))});var Hl=r.object({value:r.number().optional()});var yr=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:pe,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 Jl=r.object({content:r.list(yr).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var Ux=r.object({time:r.date(),value:r.number().optional()});var Gl=r.object({time:r.date(),value:r.number().optional()});var Kl=r.enum_(["unknown","processing","completed","failed"]);var Ho=r.object({id:r.string().optional(),versionHash:r.property("version_hash",r.string().optional()),versionName:r.property("version_name",r.string().optional()),changeDescription:r.property("change_description",r.string().optional()),tags:r.list(r.string()).optional()});var $l=r.enum_(["private","public"]);var Fx=r.object({id:r.string().optional(),name:r.string(),visibility:$l.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()),status:Kl.optional(),latestVersion:r.property("latest_version",Ho.optional())});var Nx=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 Ql=r.enum_(["manual","trace","span","sdk"]);var Jo=r.object({id:r.string().optional(),datasetItemId:r.property("dataset_item_id",r.string().optional()),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Ql,data:B,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Nt).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 Yl=r.object({generatedSamples:r.property("generated_samples",r.list(Jo).optional()),model:r.string().optional(),totalGenerated:r.property("total_generated",r.number().optional()),generationTime:r.property("generation_time",r.date().optional())});var Mx=r.object({datasetName:r.property("dataset_name",r.string().optional()),datasetId:r.property("dataset_id",r.string().optional()),items:r.list(Jo),batchGroupId:r.property("batch_group_id",r.string().optional())});var Xl=r.record(r.string(),r.unknown());var Zl=r.enum_(["manual","trace","span","sdk"]);var Ol=r.enum_(["default","hidden"]);var ql=r.enum_(["ui","sdk","online_scoring"]);var em=r.enum_(["ui","sdk","online_scoring"]);var rm=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:em.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),spanType:r.property("span_type",r.string().optional()),spanId:r.property("span_id",r.string().optional())});var tm=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:ql,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(),rm).optional())});var Fa=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var om=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:Fa.optional(),output:Fa.optional(),feedbackScores:r.property("feedback_scores",r.list(tm).optional()),comments:r.list(Bl).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",Ol.optional())});var im=r.object({id:r.string().optional(),datasetItemId:r.property("dataset_item_id",r.string().optional()),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Zl,data:B,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(om).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 am=r.object({content:r.list(im).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),columns:r.list(Nl).optional(),sortableBy:r.list(r.string()).optional()});var nm=r.enum_(["manual","trace","span","sdk"]);var sm=r.enum_(["default","hidden"]);var Go=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",sm.optional())});var Ko=r.object({id:r.string().optional(),datasetItemId:r.property("dataset_item_id",r.string().optional()),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:nm,data:B,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Go).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 pm=r.object({content:r.list(Ko).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),columns:r.list(Wl).optional(),sortableBy:r.list(r.string()).optional()});var cm=r.enum_(["unknown","processing","completed","failed"]);var lm=r.enum_(["private","public"]);var $o=r.object({id:r.string().optional(),versionHash:r.property("version_hash",r.string().optional()),versionName:r.property("version_name",r.string().optional()),changeDescription:r.property("change_description",r.string().optional()),tags:r.list(r.string()).optional()});var Lr=r.object({id:r.string().optional(),name:r.string(),visibility:lm.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()),status:cm.optional(),latestVersion:r.property("latest_version",$o.optional())});var mm=r.object({content:r.list(Lr).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),sortableBy:r.list(r.string()).optional()});var dm=r.object({itemsAdded:r.number().optional(),itemsModified:r.number().optional(),itemsDeleted:r.number().optional(),itemsUnchanged:r.number().optional()});var um=r.object({fromVersion:r.property("from_version",r.string().optional()),toVersion:r.property("to_version",r.string().optional()),statistics:dm.optional()});var br=r.object({id:r.string().optional(),datasetId:r.property("dataset_id",r.string().optional()),versionHash:r.property("version_hash",r.string().optional()),tags:r.list(r.string()).optional(),isLatest:r.property("is_latest",r.boolean().optional()),versionName:r.property("version_name",r.string().optional()),itemsTotal:r.property("items_total",r.number().optional()),itemsAdded:r.property("items_added",r.number().optional()),itemsModified:r.property("items_modified",r.number().optional()),itemsDeleted:r.property("items_deleted",r.number().optional()),changeDescription:r.property("change_description",r.string().optional()),metadata: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 fm=r.object({content:r.list(br).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional()});var hm=r.enum_(["trace","span"]);var Wx=r.object({fileNames:r.property("file_names",r.list(r.string())),entityType:r.property("entity_type",hm),entityId:r.property("entity_id",r.string()),containerId:r.property("container_id",r.string())});var Qo=r.object({name:r.string(),author:r.string().optional()});var Hr=r.object({ids:r.list(r.string())});var Yo=r.object({count:r.number().optional(),deviation:r.number().optional(),deviationPercentage:r.property("deviation_percentage",r.number().optional())});var gm=r.object({count:r.number().optional(),deviation:r.number().optional(),deviationPercentage:r.property("deviation_percentage",r.number().optional())});var Xo=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var de=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var Bx=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var Vx=r.object({errors:r.list(r.string()).optional()});var Lx=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var ym=r.enum_(["running","completed","cancelled"]);var bm=r.enum_(["regular","trial","mini-batch"]);var Na=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 Hx=r.object({id:r.string().optional(),datasetName:r.property("dataset_name",r.string()),datasetId:r.property("dataset_id",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:r.string().optional(),metadata:K.optional(),tags:r.list(r.string()).optional(),type:bm.optional(),optimizationId:r.property("optimization_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(me).optional()),comments:r.list(O).optional(),traceCount:r.property("trace_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),duration:Me.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:ym.optional(),experimentScores:r.property("experiment_scores",r.list(Et).optional()),promptVersion:r.property("prompt_version",Na.optional()),promptVersions:r.property("prompt_versions",r.list(Na).optional()),datasetVersionId:r.property("dataset_version_id",r.string().optional()),datasetVersionSummary:r.property("dataset_version_summary",Ho.optional())});var xm=r.object({label:r.string().optional(),aggregations:gp.optional()});var Rm=r.object({content:r.record(r.string(),xm).optional()});var wm=r.object({label:r.string().optional()});var _m=r.object({groupSorting:r.property("group_sorting",r.list(r.string()).optional())});var zm=r.object({groupsDetails:r.property("groups_details",r.list(_m).optional())});var km=r.object({content:r.record(r.string(),wm).optional(),details:zm.optional()});var Sm=r.enum_(["general","tool","llm","guardrail"]);var Zo=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:Sm.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:K.optional(),output:K.optional(),metadata:K.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",Ne.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(se).optional()),comments:r.list(O).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 Pm=r.object({spanId:r.property("span_id",r.string().optional()),checks:r.list(Tl).optional()});var Am=r.enum_(["default","hidden"]);var Oo=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:K.optional(),output:K.optional(),metadata:K.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Ne.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(se).optional()),spanFeedbackScores:r.property("span_feedback_scores",r.list(se).optional()),comments:r.list(O).optional(),guardrailsValidations:r.property("guardrails_validations",r.list(Pm).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",Am.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 Tm=r.object({datasetItemId:r.property("dataset_item_id",r.string()),evaluateTaskResult:r.property("evaluate_task_result",K.optional()),trace:Oo.optional(),spans:r.list(Zo).optional(),feedbackScores:r.property("feedback_scores",r.list(se).optional())});var Jx=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(Tm)});var vm=r.enum_(["running","completed","cancelled"]);var jm=r.enum_(["regular","trial","mini-batch"]);var Em=r.object({name:r.string(),value:r.number()});var ye=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var qo=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var Ma=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 ei=r.object({id:r.string().optional(),datasetName:r.property("dataset_name",r.string()),datasetId:r.property("dataset_id",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:r.string().optional(),metadata:ye.optional(),tags:r.list(r.string()).optional(),type:jm.optional(),optimizationId:r.property("optimization_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(nr).optional()),comments:r.list(gr).optional(),traceCount:r.property("trace_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),duration:qo.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:vm.optional(),experimentScores:r.property("experiment_scores",r.list(Em).optional()),promptVersion:r.property("prompt_version",Ma.optional()),promptVersions:r.property("prompt_versions",r.list(Ma).optional()),datasetVersionId:r.property("dataset_version_id",r.string().optional()),datasetVersionSummary:r.property("dataset_version_summary",$o.optional())});var Cm=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ei).optional(),sortableBy:r.list(r.string()).optional()});var Gx=B;var Im=r.object({max:r.number(),min:r.number()});var Dm=r.object({details:Im.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 Um=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()}),Kx=r.union("type",{numerical:Dm.extend(Um),categorical:fl.extend(Um),boolean:sl.extend(Um)}).transform({transform:n=>n,untransform:n=>n});var Fm=r.object({max:r.number(),min:r.number()});var Nm=r.object({details:Fm.optional()});var Mm=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional()}),Wm=r.union("type",{numerical:Nm.extend(Mm),categorical:gl.extend(Mm),boolean:cl.extend(Mm)}).transform({transform:n=>n,untransform:n=>n});var Bm=r.object({max:r.number(),min:r.number()});var ri=r.object({details:Bm.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 Vm=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()}),Lm=r.union("type",{numerical:ri.extend(Vm),categorical:Lo.extend(Vm),boolean:Vo.extend(Vm)}).transform({transform:n=>n,untransform:n=>n});var Hm=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Lm).optional()});var Jm=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()}),Gm=r.union("type",{numerical:ri.extend(Jm),categorical:Lo.extend(Jm),boolean:Vo.extend(Jm)}).transform({transform:n=>n,untransform:n=>n});var Km=r.object({name:r.string(),value:r.number()});var $m=r.enum_(["ui","sdk","online_scoring"]);var Qm=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:$m,author:r.string().optional(),id:r.string()});var ti=r.object({scores:r.list(Qm)});var Ym=r.object({name:r.string().optional(),type:r.string().optional()});var Xm=r.object({scores:r.list(Ym).optional()});var Zm=r.enum_(["ui","sdk","online_scoring"]);var Om=r.enum_(["ui","sdk","online_scoring"]);var qm=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:Om.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),spanType:r.property("span_type",r.string().optional()),spanId:r.property("span_id",r.string().optional())});var Jr=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:Zm,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(),qm).optional())});var ed=r.object({max:r.number(),min:r.number()});var rd=r.object({details:ed.optional()});var td=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional()}),od=r.union("type",{numerical:rd.extend(td),categorical:xl.extend(td),boolean:dl.extend(td)}).transform({transform:n=>n,untransform:n=>n});var id=r.enum_(["TOPIC","PII"]);var ad=r.enum_(["passed","failed"]);var nd=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:id,result:ad,config:B,details:B});var $x=r.object({guardrails:r.list(nd)});var sd=r.object({spanId:r.property("span_id",r.string().optional()),checks:r.list(El).optional()});var Qx=r.object({ids:r.list(r.string())});var pd=r.enum_(["INFO","WARN","ERROR","DEBUG","TRACE"]);var cd=r.object({timestamp:r.date().optional(),ruleId:r.property("rule_id",r.string().optional()),level:pd.optional(),message:r.string().optional(),markers:r.record(r.string(),r.string()).optional()});var ld=r.object({content:r.list(cd).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional()});var md=r.enum_(["trace","thread","span"]);var oi=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",md)});var ii=r.object({entitiesQueued:r.property("entities_queued",r.number().optional()),rulesApplied:r.property("rules_applied",r.number().optional())});var dd=r.enum_(["running","completed","cancelled","initialized","error"]);var ud=r.object({type:r.string(),parameters:B.optional()});var fd=r.object({metrics:r.list(ud)});var hd=r.object({model:r.string(),parameters:B.optional()});var gd=r.object({type:r.string(),parameters:B.optional()});var yd=r.object({role:r.string(),content:r.string()});var bd=r.object({messages:r.list(yd)});var xd=r.object({datasetName:r.property("dataset_name",r.string()),prompt:bd,llmModel:r.property("llm_model",hd),evaluation:fd,optimizer:gd});var Yx=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:dd,metadata:K.optional(),studioConfig:r.property("studio_config",xd.optional()),datasetId:r.property("dataset_id",r.string().optional()),numTrials:r.property("num_trials",r.number().optional()),feedbackScores:r.property("feedback_scores",r.list(me).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 Rd=r.enum_(["running","completed","cancelled","initialized","error"]);var wd=r.object({type:r.string(),parameters:pe.optional()});var _d=r.object({metrics:r.list(wd)});var zd=r.object({model:r.string(),parameters:pe.optional()});var kd=r.object({type:r.string(),parameters:pe.optional()});var Sd=r.object({role:r.string(),content:r.string()});var Pd=r.object({messages:r.list(Sd)});var Ad=r.object({datasetName:r.property("dataset_name",r.string()),prompt:Pd,llmModel:r.property("llm_model",zd),evaluation:_d,optimizer:kd});var ai=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:Rd,metadata:ye.optional(),studioConfig:r.property("studio_config",Ad.optional()),datasetId:r.property("dataset_id",r.string().optional()),numTrials:r.property("num_trials",r.number().optional()),feedbackScores:r.property("feedback_scores",r.list(nr).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 Td=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ai).optional(),sortableBy:r.list(r.string()).optional()});var vd=r.object({type:r.string(),parameters:he.optional()});var jd=r.object({metrics:r.list(vd)});var Ed=r.object({model:r.string(),parameters:he.optional()});var Cd=r.object({type:r.string(),parameters:he.optional()});var Id=r.object({role:r.string(),content:r.string()});var Dd=r.object({messages:r.list(Id)});var Ud=r.object({datasetName:r.property("dataset_name",r.string()),prompt:Dd,llmModel:r.property("llm_model",Ed),evaluation:jd,optimizer:Cd});var Fd=r.object({url:r.string().optional(),lastModified:r.property("last_modified",r.date().optional()),expiresAt:r.property("expires_at",r.date().optional())});var Nd=r.enum_(["running","completed","cancelled","initialized","error"]);var Wa=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:Nd,metadata:ge.optional(),studioConfig:r.property("studio_config",Ud.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var Md=r.object({columns:r.list(Ul).optional()});var Wd=r.object({value:qo.optional()});var Bd=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var Vd=r.enum_(["private","public"]);var Xx=r.object({id:r.string().optional(),name:r.string(),visibility:Vd.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(me).optional()),duration:Me.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()),threadCount:r.property("thread_count",r.number().optional()),guardrailsFailedCount:r.property("guardrails_failed_count",r.number().optional()),errorCount:r.property("error_count",Yo.optional())});var Ld=r.enum_(["private","public"]);var Hd=r.object({id:r.string().optional(),name:r.string(),visibility:Ld.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:Bd.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()),threadCount:r.property("thread_count",r.number().optional()),guardrailsFailedCount:r.property("guardrails_failed_count",r.number().optional()),errorCount:r.property("error_count",gm.optional())});var Jd=r.enum_(["HOURLY","DAILY","WEEKLY"]);var Gd=r.enum_(["FEEDBACK_SCORES","TRACE_COUNT","TOKEN_USAGE","DURATION","COST","GUARDRAILS_FAILED_COUNT","THREAD_COUNT","THREAD_DURATION","THREAD_FEEDBACK_SCORES","SPAN_FEEDBACK_SCORES","SPAN_COUNT","SPAN_DURATION","SPAN_TOKEN_USAGE"]);var Kd=r.object({name:r.string().optional(),data:r.list(Gl).optional()});var $d=r.object({projectId:r.property("project_id",r.string().optional()),metricType:r.property("metric_type",Gd.optional()),interval:Jd.optional(),results:r.list(Kd).optional()});var Qd=r.enum_(["private","public"]);var ni=r.object({id:r.string().optional(),name:r.string(),visibility:Qd.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 Yd=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ni).optional(),sortableBy:r.list(r.string()).optional()});var Xd=r.object({name:r.string().optional()}),Zd=r.union("type",{PERCENTAGE:Wd.extend(Xd),COUNT:Hl.extend(Xd),AVG:il.extend(Xd)}).transform({transform:n=>n,untransform:n=>n});var Je=r.object({stats:r.list(Zd).optional()});var Od=r.object({projectId:r.property("project_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(me).optional()),duration:Me.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()),threadCount:r.property("thread_count",r.number().optional()),guardrailsFailedCount:r.property("guardrails_failed_count",r.number().optional()),errorCount:r.property("error_count",Yo.optional())});var qd=r.object({content:r.list(Od).optional()});var eu=r.enum_(["text","chat"]);var ru=r.enum_(["mustache","jinja2"]);var tu=r.enum_(["text","chat"]);var ou=r.enum_(["mustache","jinja2"]);var iu=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:B.optional(),type:ou.optional(),changeDescription:r.property("change_description",r.string().optional()),tags:r.list(r.string()).optional(),variables:r.list(r.string()).optional(),templateStructure:r.property("template_structure",tu.optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Zx=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),template:r.string().optional(),metadata:B.optional(),changeDescription:r.property("change_description",r.string().optional()),type:ru.optional(),templateStructure:r.property("template_structure",eu.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",iu.optional())});var au=r.enum_(["text","chat"]);var nu=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),templateStructure:r.property("template_structure",au.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",Ee.optional())});var su=r.enum_(["text","chat"]);var pu=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),templateStructure:r.property("template_structure",su.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 cu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(pu).optional(),sortableBy:r.list(r.string()).optional()});var lu=r.enum_(["text","chat"]);var mu=r.enum_(["mustache","jinja2"]);var du=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:pe.optional(),type:mu.optional(),changeDescription:r.property("change_description",r.string().optional()),tags:r.list(r.string()).optional(),templateStructure:r.property("template_structure",lu.optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var uu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(du).optional(),sortableBy:r.list(r.string()).optional()});var fu=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","bedrock","custom-llm","opik-free"]);var Ox=r.object({id:r.string().optional(),provider:fu,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()),readOnly:r.property("read_only",r.boolean().optional())});var hu=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","bedrock","custom-llm","opik-free"]);var si=r.object({id:r.string().optional(),provider:hu,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()),readOnly:r.property("read_only",r.boolean().optional())});var gu=r.object({size:r.number().optional(),total:r.number().optional(),content:r.list(si).optional(),sortableBy:r.list(r.string()).optional()});var xr=r.object({name:r.string().optional(),current:r.number().optional(),previous:r.number().optional()});var yu=r.object({pythonEvaluatorEnabled:r.boolean(),traceThreadPythonEvaluatorEnabled:r.boolean(),spanLlmAsJudgeEnabled:r.boolean(),spanUserDefinedMetricPythonEnabled:r.boolean(),guardrailsEnabled:r.boolean(),opikAiEnabled:r.property("opikAIEnabled",r.boolean()),alertsEnabled:r.boolean(),welcomeWizardEnabled:r.boolean(),csvUploadEnabled:r.boolean(),exportEnabled:r.boolean(),optimizationStudioEnabled:r.boolean(),datasetVersioningEnabled:r.boolean(),datasetExportEnabled:r.boolean(),openaiProviderEnabled:r.boolean(),anthropicProviderEnabled:r.boolean(),geminiProviderEnabled:r.boolean(),openrouterProviderEnabled:r.boolean(),vertexaiProviderEnabled:r.boolean(),bedrockProviderEnabled:r.boolean(),customllmProviderEnabled:r.boolean(),collaboratorsTabEnabled:r.boolean()});var qx=r.object({spans:r.list(Zo)});var bu=r.enum_(["general","tool","llm","guardrail"]);var pi=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:bu.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:ye.optional(),output:ye.optional(),metadata:ye.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",Xo.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(Jr).optional()),comments:r.list(gr).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 xu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(pi).optional(),sortableBy:r.list(r.string()).optional()});var Ru=r.object({workspace:r.string().optional(),spanCount:r.property("span_count",r.number().optional())});var wu=r.object({workspacesSpansCount:r.property("workspaces_spans_count",r.list(Ru).optional())});var _u=r.object({uploadId:r.property("upload_id",r.string()),preSignUrls:r.property("pre_sign_urls",r.list(r.string()))});var eR=r.object({traces:r.list(Oo)});var zu=r.object({workspace:r.string().optional(),traceCount:r.property("trace_count",r.number().optional())});var ku=r.object({workspacesTracesCount:r.property("workspaces_traces_count",r.list(zu).optional())});var Su=r.enum_(["default","hidden"]);var ci=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:ye.optional(),output:ye.optional(),metadata:ye.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Xo.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(Jr).optional()),spanFeedbackScores:r.property("span_feedback_scores",r.list(Jr).optional()),comments:r.list(gr).optional(),guardrailsValidations:r.property("guardrails_validations",r.list(sd).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",Su.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 Pu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ci).optional(),sortableBy:r.list(r.string()).optional()});var Au=r.enum_(["active","inactive"]);var li=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",K.optional()),lastMessage:r.property("last_message",K.optional()),feedbackScores:r.property("feedback_scores",r.list(se).optional()),status:Au.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(O).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 Ba=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 Tu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(li).optional(),sortableBy:r.list(r.string()).optional()});var vu=r.object({responseExamples:r.property("response_examples",r.record(r.string(),r.record(r.string(),r.unknown())).optional())});var ju=r.enum_(["success","failure"]);var Eu=r.object({status:ju.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 Cu=r.object({completed:r.boolean().optional()});var mi=r.object({timeoutToMarkThreadAsInactive:r.property("timeout_to_mark_thread_as_inactive",r.string().optional()),truncationOnTables:r.property("truncation_on_tables",r.boolean().optional())});var rR=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 Va=r.object({results:r.list(xr).optional()});var Gr=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 Iu=r.object({results:r.list(xr).optional()});var Du=r.object({workspaceName:r.property("workspace_name",r.string().optional())});var La=class{constructor(o={}){this._options=F(o);}findAlerts(o={},e){return _.fromPromise(this.__findAlerts(o,e))}async __findAlerts(o={},e){var d,m,f,u,h,g,x,T,v,E,C;let{page:t,size:i,sorting:a,filters:s}=o,p={page:t,size:i,sorting:a,filters:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/private/alerts"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:vp.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});return A(c.error,c.rawResponse,"GET","/v1/private/alerts")}createAlert(o,e){return _.fromPromise(this.__createAlert(o,e))}async __createAlert(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/alerts"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:_o.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 409:throw new $(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/alerts")}deleteAlertBatch(o,e){return _.fromPromise(this.__deleteAlertBatch(o,e))}async __deleteAlertBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/alerts/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/alerts/delete")}getAlertById(o,e={},t){return _.fromPromise(this.__getAlertById(o,e,t))}async __getAlertById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/alerts/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:wo.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/alerts/{id}")}updateAlert(o,e,t){return _.fromPromise(this.__updateAlert(o,e,t))}async __updateAlert(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/alerts/${R.encodePathParam(o)}`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:_o.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new D(s.error.body,s.rawResponse);case 409:throw new $(s.error.body,s.rawResponse);case 422:throw new Z(s.error.body,s.rawResponse);default:throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return A(s.error,s.rawResponse,"PUT","/v1/private/alerts/{id}")}getWebhookExamples(o={},e){return _.fromPromise(this.__getWebhookExamples(o,e))}async __getWebhookExamples(o={},e){var p,l,c,d,m,f,u,h,g,x,T;let{alertType:t}=o,i={alert_type:t!=null?$i.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0},a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=e==null?void 0:e.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),e==null?void 0:e.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,"v1/private/alerts/webhooks/examples"),method:"GET",headers:a,queryParameters:{...i,...e==null?void 0:e.queryParams},timeoutMs:((h=(u=e==null?void 0:e.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=e==null?void 0:e.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:vu.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/alerts/webhooks/examples")}testWebhook(o,e){return _.fromPromise(this.__testWebhook(o,e))}async __testWebhook(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/alerts/webhooks/tests"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:_o.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Eu.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===422?new Z(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/alerts/webhooks/tests")}};var Ha=class{constructor(o={}){this._options=F(o);}addItemsToAnnotationQueue(o,e,t){return _.fromPromise(this.__addItemsToAnnotationQueue(o,e,t))}async __addItemsToAnnotationQueue(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/annotation-queues/${R.encodePathParam(o)}/items/add`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Da.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/annotation-queues/{id}/items/add")}findAnnotationQueues(o={},e){return _.fromPromise(this.__findAnnotationQueues(o,e))}async __findAnnotationQueues(o={},e){var m,f,u,h,g,x,T,v,E,C,U;let{page:t,size:i,name:a,filters:s,sorting:p}=o,l={page:t,size:i,name:a,filters:s,sorting:p},c=z((m=this._options)==null?void 0:m.headers,P({"Comet-Workspace":(u=e==null?void 0:e.workspaceName)!=null?u:(f=this._options)==null?void 0:f.workspaceName}),e==null?void 0:e.headers),d=await k({url:R.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:S.Default,"v1/private/annotation-queues"),method:"GET",headers:c,queryParameters:{...l,...e==null?void 0:e.queryParams},timeoutMs:((v=(T=e==null?void 0:e.timeoutInSeconds)!=null?T:(x=this._options)==null?void 0:x.timeoutInSeconds)!=null?v:60)*1e3,maxRetries:(C=e==null?void 0:e.maxRetries)!=null?C:(E=this._options)==null?void 0:E.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(U=this._options)==null?void 0:U.fetch,logging:this._options.logging});if(d.ok)return {data:Vp.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")throw new w({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse});return A(d.error,d.rawResponse,"GET","/v1/private/annotation-queues")}createAnnotationQueue(o,e){return _.fromPromise(this.__createAnnotationQueue(o,e))}async __createAnnotationQueue(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/annotation-queues"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:st.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/annotation-queues")}createAnnotationQueueBatch(o,e){return _.fromPromise(this.__createAnnotationQueueBatch(o,e))}async __createAnnotationQueueBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/annotation-queues/batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:pt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 409:throw new $(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/annotation-queues/batch")}deleteAnnotationQueueBatch(o,e){return _.fromPromise(this.__deleteAnnotationQueueBatch(o,e))}async __deleteAnnotationQueueBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/annotation-queues/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/annotation-queues/delete")}getAnnotationQueueById(o,e={},t){return _.fromPromise(this.__getAnnotationQueueById(o,e,t))}async __getAnnotationQueueById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/annotation-queues/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:zo.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/annotation-queues/{id}")}updateAnnotationQueue(o,e={},t){return _.fromPromise(this.__updateAnnotationQueue(o,e,t))}async __updateAnnotationQueue(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/annotation-queues/${R.encodePathParam(o)}`),method:"PATCH",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ct.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===400?new D(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"PATCH","/v1/private/annotation-queues/{id}")}removeItemsFromAnnotationQueue(o,e,t){return _.fromPromise(this.__removeItemsFromAnnotationQueue(o,e,t))}async __removeItemsFromAnnotationQueue(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/annotation-queues/${R.encodePathParam(o)}/items/delete`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Da.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/annotation-queues/{id}/items/delete")}};var Ja=class{constructor(o={}){this._options=F(o);}attachmentList(o,e){return _.fromPromise(this.__attachmentList(o,e))}async __attachmentList(o,e){var f,u,h,g,x,T,v,E,C,U,M;let{page:t,size:i,projectId:a,entityType:s,entityId:p,path:l}=o,c={page:t,size:i,project_id:a,entity_type:Oi.jsonOrThrow(s,{unrecognizedObjectKeys:"strip",omitUndefined:true}),entity_id:p,path:l},d=z((f=this._options)==null?void 0:f.headers,P({"Comet-Workspace":(h=e==null?void 0:e.workspaceName)!=null?h:(u=this._options)==null?void 0:u.workspaceName}),e==null?void 0:e.headers),m=await k({url:R.join((x=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?x:S.Default,"v1/private/attachment/list"),method:"GET",headers:d,queryParameters:{...c,...e==null?void 0:e.queryParams},timeoutMs:((E=(v=e==null?void 0:e.timeoutInSeconds)!=null?v:(T=this._options)==null?void 0:T.timeoutInSeconds)!=null?E:60)*1e3,maxRetries:(U=e==null?void 0:e.maxRetries)!=null?U:(C=this._options)==null?void 0:C.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(M=this._options)==null?void 0:M.fetch,logging:this._options.logging});if(m.ok)return {data:Kp.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 401:throw new re(m.error.body,m.rawResponse);case 403:throw new ne(de.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new w({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return A(m.error,m.rawResponse,"GET","/v1/private/attachment/list")}completeMultiPartUpload(o,e){return _.fromPromise(this.__completeMultiPartUpload(o,e))}async __completeMultiPartUpload(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/attachment/upload-complete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ua.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 401:throw new re(i.error.body,i.rawResponse);case 403:throw new ne(de.parseOrThrow(i.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/attachment/upload-complete")}deleteAttachments(o,e){return _.fromPromise(this.__deleteAttachments(o,e))}async __deleteAttachments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/attachment/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ua.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 401:throw new re(i.error.body,i.rawResponse);case 403:throw new ne(de.parseOrThrow(i.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/attachment/delete")}downloadAttachment(o,e){return _.fromPromise(this.__downloadAttachment(o,e))}async __downloadAttachment(o,e){var f,u,h,g,x,T,v,E,C,U,M;let{workspaceName:t,containerId:i,entityType:a,entityId:s,fileName:p,mimeType:l}=o,c={workspace_name:t,container_id:i,entity_type:qi.jsonOrThrow(a,{unrecognizedObjectKeys:"strip",omitUndefined:true}),entity_id:s,file_name:p,mime_type:l},d=z((f=this._options)==null?void 0:f.headers,P({"Comet-Workspace":(h=e==null?void 0:e.workspaceName)!=null?h:(u=this._options)==null?void 0:u.workspaceName}),e==null?void 0:e.headers),m=await k({url:R.join((x=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?x:S.Default,"v1/private/attachment/download"),method:"GET",headers:d,queryParameters:{...c,...e==null?void 0:e.queryParams},responseType:"streaming",timeoutMs:((E=(v=e==null?void 0:e.timeoutInSeconds)!=null?v:(T=this._options)==null?void 0:T.timeoutInSeconds)!=null?E:60)*1e3,maxRetries:(U=e==null?void 0:e.maxRetries)!=null?U:(C=this._options)==null?void 0:C.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(M=this._options)==null?void 0:M.fetch,logging:this._options.logging});if(m.ok)return {data:m.body,rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 401:throw new re(m.error.body,m.rawResponse);case 403:throw new ne(de.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new w({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return A(m.error,m.rawResponse,"GET","/v1/private/attachment/download")}startMultiPartUpload(o,e){return _.fromPromise(this.__startMultiPartUpload(o,e))}async __startMultiPartUpload(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/attachment/upload-start"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:lt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:_u.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 401:throw new re(i.error.body,i.rawResponse);case 403:throw new ne(de.parseOrThrow(i.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/attachment/upload-start")}uploadAttachment(o,e){return _.fromPromise(this.__uploadAttachment(o,e))}async __uploadAttachment(o,e){var f,u,h,g,x,T,v,E,C,U,M;let{fileName:t,projectName:i,mimeType:a,entityType:s,entityId:p,body:l}=o,c={file_name:t,project_name:i,mime_type:a,entity_type:ea.jsonOrThrow(s,{unrecognizedObjectKeys:"strip",omitUndefined:true}),entity_id:p},d=z((f=this._options)==null?void 0:f.headers,P({"Comet-Workspace":(h=e==null?void 0:e.workspaceName)!=null?h:(u=this._options)==null?void 0:u.workspaceName}),e==null?void 0:e.headers),m=await k({url:R.join((x=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?x:S.Default,"v1/private/attachment/upload"),method:"PUT",headers:d,contentType:"application/json",queryParameters:{...c,...e==null?void 0:e.queryParams},requestType:"json",body:Er.uploadAttachment.Request.jsonOrThrow(l,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((E=(v=e==null?void 0:e.timeoutInSeconds)!=null?v:(T=this._options)==null?void 0:T.timeoutInSeconds)!=null?E:60)*1e3,maxRetries:(U=e==null?void 0:e.maxRetries)!=null?U:(C=this._options)==null?void 0:C.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(M=this._options)==null?void 0:M.fetch,logging:this._options.logging});if(m.ok)return {data:void 0,rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 401:throw new re(m.error.body,m.rawResponse);case 403:throw new ne(de.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new w({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return A(m.error,m.rawResponse,"PUT","/v1/private/attachment/upload")}};var Ga=class{constructor(o={}){this._options=F(o);}findEvaluators(o={},e){return _.fromPromise(this.__findEvaluators(o,e))}async __findEvaluators(o={},e){var u,h,g,x,T,v,E,C,U,M,X;let{projectId:t,id:i,name:a,filters:s,sorting:p,page:l,size:c}=o,d={project_id:t,id:i,name:a,filters:s,sorting:p,page:l,size:c},m=z((u=this._options)==null?void 0:u.headers,P({"Comet-Workspace":(g=e==null?void 0:e.workspaceName)!=null?g:(h=this._options)==null?void 0:h.workspaceName}),e==null?void 0:e.headers),f=await k({url:R.join((T=(x=await b.get(this._options.baseUrl))!=null?x:await b.get(this._options.environment))!=null?T:S.Default,"v1/private/automations/evaluators"),method:"GET",headers:m,queryParameters:{...d,...e==null?void 0:e.queryParams},timeoutMs:((C=(E=e==null?void 0:e.timeoutInSeconds)!=null?E:(v=this._options)==null?void 0:v.timeoutInSeconds)!=null?C:60)*1e3,maxRetries:(M=e==null?void 0:e.maxRetries)!=null?M:(U=this._options)==null?void 0:U.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(X=this._options)==null?void 0:X.fetch,logging:this._options.logging});if(f.ok)return {data:Ic.parseOrThrow(f.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:f.rawResponse};if(f.error.reason==="status-code")throw new w({statusCode:f.error.statusCode,body:f.error.body,rawResponse:f.rawResponse});return A(f.error,f.rawResponse,"GET","/v1/private/automations/evaluators")}createAutomationRuleEvaluator(o,e){return _.fromPromise(this.__createAutomationRuleEvaluator(o,e))}async __createAutomationRuleEvaluator(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/automations/evaluators"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ol.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/automations/evaluators")}deleteAutomationRuleEvaluatorBatch(o,e){return _.fromPromise(this.__deleteAutomationRuleEvaluatorBatch(o,e))}async __deleteAutomationRuleEvaluatorBatch(o,e){var l,c,d,m,f,u,h,g,x,T,v;let{projectId:t,body:i}=o,a={project_id:t},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=e==null?void 0:e.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),e==null?void 0:e.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,"v1/private/automations/evaluators/delete"),method:"POST",headers:s,contentType:"application/json",queryParameters:{...a,...e==null?void 0:e.queryParams},requestType:"json",body:Y.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((g=(h=e==null?void 0:e.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=e==null?void 0:e.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:void 0,rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"POST","/v1/private/automations/evaluators/delete")}getEvaluatorById(o,e={},t){return _.fromPromise(this.__getEvaluatorById(o,e,t))}async __getEvaluatorById(o,e={},t){var l,c,d,m,f,u,h,g,x,T,v;let{projectId:i}=e,a={project_id:i},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=t==null?void 0:t.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),t==null?void 0:t.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,`v1/private/automations/evaluators/${R.encodePathParam(o)}`),method:"GET",headers:s,queryParameters:{...a,...t==null?void 0:t.queryParams},timeoutMs:((g=(h=t==null?void 0:t.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=t==null?void 0:t.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:Uc.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"GET","/v1/private/automations/evaluators/{id}")}updateAutomationRuleEvaluator(o,e,t){return _.fromPromise(this.__updateAutomationRuleEvaluator(o,e,t))}async __updateAutomationRuleEvaluator(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/automations/evaluators/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:qc.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/automations/evaluators/{id}")}getEvaluatorLogsById(o,e={},t){return _.fromPromise(this.__getEvaluatorLogsById(o,e,t))}async __getEvaluatorLogsById(o,e={},t){var l,c,d,m,f,u,h,g,x,T,v;let{size:i}=e,a={size:i},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=t==null?void 0:t.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),t==null?void 0:t.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,`v1/private/automations/evaluators/${R.encodePathParam(o)}/logs`),method:"GET",headers:s,queryParameters:{...a,...t==null?void 0:t.queryParams},timeoutMs:((g=(h=t==null?void 0:t.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=t==null?void 0:t.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:ld.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"GET","/v1/private/automations/evaluators/{id}/logs")}};var Ka=class{constructor(o={}){this._options=F(o);}createChatCompletions(o={},e){return _.fromPromise(this.__createChatCompletions(o,e))}async __createChatCompletions(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/chat/completions"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:dt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Sl.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/chat/completions")}};var $a=class{constructor(o={}){this._options=F(o);}access(o,e){return _.fromPromise(this.__access(o,e))}async __access(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/auth"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Xp.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 401:throw new re(i.error.body,i.rawResponse);case 403:throw new ne(de.parseOrThrow(i.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/auth")}getWorkspaceName(o){return _.fromPromise(this.__getWorkspaceName(o))}async __getWorkspaceName(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/auth/workspace"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Du.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")switch(t.error.statusCode){case 401:throw new re(t.error.body,t.rawResponse);case 403:throw new ne(de.parseOrThrow(t.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),t.rawResponse);default:throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse})}return A(t.error,t.rawResponse,"GET","/v1/private/auth/workspace")}};var Qa=class{constructor(o={}){this._options=F(o);}findDashboards(o={},e){return _.fromPromise(this.__findDashboards(o,e))}async __findDashboards(o={},e){var d,m,f,u,h,g,x,T,v,E,C;let{page:t,size:i,name:a,sorting:s}=o,p={page:t,size:i,name:a,sorting:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/private/dashboards"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:Jl.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});return A(c.error,c.rawResponse,"GET","/v1/private/dashboards")}createDashboard(o,e){return _.fromPromise(this.__createDashboard(o,e))}async __createDashboard(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/dashboards"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ft.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:yr.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/dashboards")}getDashboardById(o,e={},t){return _.fromPromise(this.__getDashboardById(o,e,t))}async __getDashboardById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/dashboards/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:yr.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/dashboards/{dashboardId}")}deleteDashboard(o,e={},t){return _.fromPromise(this.__deleteDashboard(o,e,t))}async __deleteDashboard(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/dashboards/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/dashboards/{dashboardId}")}updateDashboard(o,e={},t){return _.fromPromise(this.__updateDashboard(o,e,t))}async __updateDashboard(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/dashboards/${R.encodePathParam(o)}`),method:"PATCH",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ut.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:yr.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new I(a.error.body,a.rawResponse);case 409:throw new $(a.error.body,a.rawResponse);default:throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}return A(a.error,a.rawResponse,"PATCH","/v1/private/dashboards/{dashboardId}")}deleteDashboardsBatch(o,e){return _.fromPromise(this.__deleteDashboardsBatch(o,e))}async __deleteDashboardsBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/dashboards/delete-batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/dashboards/delete-batch")}};var Ya=class{constructor(o={}){this._options=F(o);}applyDatasetItemChanges(o,e,t){return _.fromPromise(this.__applyDatasetItemChanges(o,e,t))}async __applyDatasetItemChanges(o,e,t){var c,d,m,f,u,h,g,x,T,v,E;let{override:i,body:a}=e,s={override:i},p=z((c=this._options)==null?void 0:c.headers,P({"Comet-Workspace":(m=t==null?void 0:t.workspaceName)!=null?m:(d=this._options)==null?void 0:d.workspaceName}),t==null?void 0:t.headers),l=await k({url:R.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items/changes`),method:"POST",headers:p,contentType:"application/json",queryParameters:{...s,...t==null?void 0:t.queryParams},requestType:"json",body:Xl.jsonOrThrow(a,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((x=(g=t==null?void 0:t.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?x:60)*1e3,maxRetries:(v=t==null?void 0:t.maxRetries)!=null?v:(T=this._options)==null?void 0:T.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(E=this._options)==null?void 0:E.fetch,logging:this._options.logging});if(l.ok)return {data:br.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new D(l.error.body,l.rawResponse);case 404:throw new I(l.error.body,l.rawResponse);case 409:throw new $(l.error.body,l.rawResponse);default:throw new w({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return A(l.error,l.rawResponse,"POST","/v1/private/datasets/{id}/items/changes")}batchUpdateDatasetItems(o,e){return _.fromPromise(this.__batchUpdateDatasetItems(o,e))}async __batchUpdateDatasetItems(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/items/batch"),method:"PATCH",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:wt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PATCH","/v1/private/datasets/items/batch")}findDatasets(o={},e){return _.fromPromise(this.__findDatasets(o,e))}async __findDatasets(o={},e){var h,g,x,T,v,E,C,U,M,X,ie;let{page:t,size:i,withExperimentsOnly:a,withOptimizationsOnly:s,promptId:p,name:l,sorting:c,filters:d}=o,m={page:t,size:i,with_experiments_only:a,with_optimizations_only:s,prompt_id:p,name:l,sorting:c,filters:d},f=z((h=this._options)==null?void 0:h.headers,P({"Comet-Workspace":(x=e==null?void 0:e.workspaceName)!=null?x:(g=this._options)==null?void 0:g.workspaceName}),e==null?void 0:e.headers),u=await k({url:R.join((v=(T=await b.get(this._options.baseUrl))!=null?T:await b.get(this._options.environment))!=null?v:S.Default,"v1/private/datasets"),method:"GET",headers:f,queryParameters:{...m,...e==null?void 0:e.queryParams},timeoutMs:((U=(C=e==null?void 0:e.timeoutInSeconds)!=null?C:(E=this._options)==null?void 0:E.timeoutInSeconds)!=null?U:60)*1e3,maxRetries:(X=e==null?void 0:e.maxRetries)!=null?X:(M=this._options)==null?void 0:M.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(ie=this._options)==null?void 0:ie.fetch,logging:this._options.logging});if(u.ok)return {data:mm.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")throw new w({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse});return A(u.error,u.rawResponse,"GET","/v1/private/datasets")}createDataset(o,e){return _.fromPromise(this.__createDataset(o,e))}async __createDataset(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:jt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/datasets")}createOrUpdateDatasetItems(o,e){return _.fromPromise(this.__createOrUpdateDatasetItems(o,e))}async __createOrUpdateDatasetItems(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/items"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:zt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/datasets/items")}createDatasetItemsFromCsv(o,e){return _.fromPromise(this.__createDatasetItemsFromCsv(o,e))}async __createDatasetItemsFromCsv(o,e){var p,l,c,d,m,f,u,h,g,x,T;let t=await Of();t.append("file",Se(o.file)),t.append("dataset_id",o.datasetId);let i=await t.getRequest(),a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=e==null?void 0:e.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName,...i.headers}),e==null?void 0:e.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,"v1/private/datasets/items/from-csv"),method:"POST",headers:a,queryParameters:e==null?void 0:e.queryParams,requestType:"file",duplex:i.duplex,body:i.body,timeoutMs:((h=(u=e==null?void 0:e.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=e==null?void 0:e.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new D(s.error.body,s.rawResponse);case 404:throw new I(s.error.body,s.rawResponse);default:throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return A(s.error,s.rawResponse,"POST","/v1/private/datasets/items/from-csv")}createDatasetItemsFromSpans(o,e,t){return _.fromPromise(this.__createDatasetItemsFromSpans(o,e,t))}async __createDatasetItemsFromSpans(o,e,t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items/from-spans`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ht.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"POST","/v1/private/datasets/{dataset_id}/items/from-spans")}createDatasetItemsFromTraces(o,e,t){return _.fromPromise(this.__createDatasetItemsFromTraces(o,e,t))}async __createDatasetItemsFromTraces(o,e,t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items/from-traces`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:gt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"POST","/v1/private/datasets/{dataset_id}/items/from-traces")}getDatasetById(o,e={},t){return _.fromPromise(this.__getDatasetById(o,e,t))}async __getDatasetById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Lr.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/datasets/{id}")}updateDataset(o,e,t){return _.fromPromise(this.__updateDataset(o,e,t))}async __updateDataset(o,e,t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}`),method:"PUT",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Pt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"PUT","/v1/private/datasets/{id}")}deleteDataset(o,e={},t){return _.fromPromise(this.__deleteDataset(o,e,t))}async __deleteDataset(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/datasets/{id}")}deleteDatasetByName(o,e){return _.fromPromise(this.__deleteDatasetByName(o,e))}async __deleteDatasetByName(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:bt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/datasets/delete")}deleteDatasetItems(o={},e){return _.fromPromise(this.__deleteDatasetItems(o,e))}async __deleteDatasetItems(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/items/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:St.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/datasets/items/delete")}deleteDatasetsBatch(o,e){return _.fromPromise(this.__deleteDatasetsBatch(o,e))}async __deleteDatasetsBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/delete-batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/datasets/delete-batch")}downloadDatasetExport(o,e={},t){return _.fromPromise(this.__downloadDatasetExport(o,e,t))}async __downloadDatasetExport(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/export-jobs/${R.encodePathParam(o)}/download`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,responseType:"streaming",timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:a.body,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new D(a.error.body,a.rawResponse);case 404:throw new I(a.error.body,a.rawResponse);default:throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}return A(a.error,a.rawResponse,"GET","/v1/private/datasets/export-jobs/{jobId}/download")}expandDataset(o,e,t){return _.fromPromise(this.__expandDataset(o,e,t))}async __expandDataset(o,e,t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/expansions`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:yt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Yl.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"POST","/v1/private/datasets/{id}/expansions")}findDatasetItemsWithExperimentItems(o,e,t){return _.fromPromise(this.__findDatasetItemsWithExperimentItems(o,e,t))}async __findDatasetItemsWithExperimentItems(o,e,t){var h,g,x,T,v,E,C,U,M,X,ie;let{page:i,size:a,experimentIds:s,filters:p,sorting:l,search:c,truncate:d}=e,m={page:i,size:a,experiment_ids:s,filters:p,sorting:l,search:c,truncate:d},f=z((h=this._options)==null?void 0:h.headers,P({"Comet-Workspace":(x=t==null?void 0:t.workspaceName)!=null?x:(g=this._options)==null?void 0:g.workspaceName}),t==null?void 0:t.headers),u=await k({url:R.join((v=(T=await b.get(this._options.baseUrl))!=null?T:await b.get(this._options.environment))!=null?v:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items/experiments/items`),method:"GET",headers:f,queryParameters:{...m,...t==null?void 0:t.queryParams},timeoutMs:((U=(C=t==null?void 0:t.timeoutInSeconds)!=null?C:(E=this._options)==null?void 0:E.timeoutInSeconds)!=null?U:60)*1e3,maxRetries:(X=t==null?void 0:t.maxRetries)!=null?X:(M=this._options)==null?void 0:M.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(ie=this._options)==null?void 0:ie.fetch,logging:this._options.logging});if(u.ok)return {data:am.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")throw new w({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse});return A(u.error,u.rawResponse,"GET","/v1/private/datasets/{id}/items/experiments/items")}getDatasetByIdentifier(o,e){return _.fromPromise(this.__getDatasetByIdentifier(o,e))}async __getDatasetByIdentifier(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/retrieve"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:xt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Lr.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/datasets/retrieve")}getDatasetExperimentItemsStats(o,e,t){return _.fromPromise(this.__getDatasetExperimentItemsStats(o,e,t))}async __getDatasetExperimentItemsStats(o,e,t){var c,d,m,f,u,h,g,x,T,v,E;let{experimentIds:i,filters:a}=e,s={experiment_ids:i,filters:a},p=z((c=this._options)==null?void 0:c.headers,P({"Comet-Workspace":(m=t==null?void 0:t.workspaceName)!=null?m:(d=this._options)==null?void 0:d.workspaceName}),t==null?void 0:t.headers),l=await k({url:R.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items/experiments/items/stats`),method:"GET",headers:p,queryParameters:{...s,...t==null?void 0:t.queryParams},timeoutMs:((x=(g=t==null?void 0:t.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?x:60)*1e3,maxRetries:(v=t==null?void 0:t.maxRetries)!=null?v:(T=this._options)==null?void 0:T.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(E=this._options)==null?void 0:E.fetch,logging:this._options.logging});if(l.ok)return {data:Je.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")throw new w({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse});return A(l.error,l.rawResponse,"GET","/v1/private/datasets/{id}/items/experiments/items/stats")}getDatasetExportJob(o,e={},t){return _.fromPromise(this.__getDatasetExportJob(o,e,t))}async __getDatasetExportJob(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/export-jobs/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Cr.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/datasets/export-jobs/{jobId}")}getDatasetExportJobs(o){return _.fromPromise(this.__getDatasetExportJobs(o))}async __getDatasetExportJobs(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/datasets/export-jobs"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Ir.getDatasetExportJobs.Response.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/private/datasets/export-jobs")}getDatasetItemById(o,e={},t){return _.fromPromise(this.__getDatasetItemById(o,e,t))}async __getDatasetItemById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/items/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Ko.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/datasets/items/{itemId}")}patchDatasetItem(o,e,t){return _.fromPromise(this.__patchDatasetItem(o,e,t))}async __patchDatasetItem(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/datasets/items/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:_t.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/datasets/items/{itemId}")}getDatasetItems(o,e={},t){return _.fromPromise(this.__getDatasetItems(o,e,t))}async __getDatasetItems(o,e={},t){var f,u,h,g,x,T,v,E,C,U,M;let{page:i,size:a,version:s,filters:p,truncate:l}=e,c={page:i,size:a,version:s,filters:p,truncate:l},d=z((f=this._options)==null?void 0:f.headers,P({"Comet-Workspace":(h=t==null?void 0:t.workspaceName)!=null?h:(u=this._options)==null?void 0:u.workspaceName}),t==null?void 0:t.headers),m=await k({url:R.join((x=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?x:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items`),method:"GET",headers:d,queryParameters:{...c,...t==null?void 0:t.queryParams},timeoutMs:((E=(v=t==null?void 0:t.timeoutInSeconds)!=null?v:(T=this._options)==null?void 0:T.timeoutInSeconds)!=null?E:60)*1e3,maxRetries:(U=t==null?void 0:t.maxRetries)!=null?U:(C=this._options)==null?void 0:C.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(M=this._options)==null?void 0:M.fetch,logging:this._options.logging});if(m.ok)return {data:pm.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")throw new w({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse});return A(m.error,m.rawResponse,"GET","/v1/private/datasets/{id}/items")}getDatasetItemsOutputColumns(o,e={},t){return _.fromPromise(this.__getDatasetItemsOutputColumns(o,e,t))}async __getDatasetItemsOutputColumns(o,e={},t){var l,c,d,m,f,u,h,g,x,T,v;let{experimentIds:i}=e,a={experiment_ids:i},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=t==null?void 0:t.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),t==null?void 0:t.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items/experiments/items/output/columns`),method:"GET",headers:s,queryParameters:{...a,...t==null?void 0:t.queryParams},timeoutMs:((g=(h=t==null?void 0:t.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=t==null?void 0:t.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:Md.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"GET","/v1/private/datasets/{id}/items/experiments/items/output/columns")}markDatasetExportJobViewed(o,e={},t){return _.fromPromise(this.__markDatasetExportJobViewed(o,e,t))}async __markDatasetExportJobViewed(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/export-jobs/${R.encodePathParam(o)}/mark-viewed`),method:"PUT",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"PUT","/v1/private/datasets/export-jobs/{jobId}/mark-viewed")}startDatasetExport(o,e={},t){return _.fromPromise(this.__startDatasetExport(o,e,t))}async __startDatasetExport(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/export`),method:"POST",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Cr.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"POST","/v1/private/datasets/{id}/export")}streamDatasetItems(o,e){return _.fromPromise(this.__streamDatasetItems(o,e))}async __streamDatasetItems(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/items/stream"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:kt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),responseType:"streaming",timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:i.body,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/datasets/items/stream")}compareDatasetVersions(o,e={},t){return _.fromPromise(this.__compareDatasetVersions(o,e,t))}async __compareDatasetVersions(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/versions/diff`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:um.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/datasets/{id}/versions/diff")}createVersionTag(o,e,t,i){return _.fromPromise(this.__createVersionTag(o,e,t,i))}async __createVersionTag(o,e,t,i){var p,l,c,d,m,f,u,h,g,x,T;let a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=i==null?void 0:i.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),i==null?void 0:i.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/versions/hash/${R.encodePathParam(e)}/tags`),method:"POST",headers:a,contentType:"application/json",queryParameters:i==null?void 0:i.queryParams,requestType:"json",body:Tt.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=i==null?void 0:i.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=i==null?void 0:i.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:i==null?void 0:i.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new D(s.error.body,s.rawResponse);case 404:throw new I(s.error.body,s.rawResponse);case 409:throw new $(s.error.body,s.rawResponse);default:throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return A(s.error,s.rawResponse,"POST","/v1/private/datasets/{id}/versions/hash/{versionHash}/tags")}deleteVersionTag(o,e,t,i={},a){return _.fromPromise(this.__deleteVersionTag(o,e,t,i,a))}async __deleteVersionTag(o,e,t,i={},a){var l,c,d,m,f,u,h,g,x,T,v;let s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=a==null?void 0:a.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),a==null?void 0:a.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/versions/${R.encodePathParam(e)}/tags/${R.encodePathParam(t)}`),method:"DELETE",headers:s,queryParameters:a==null?void 0:a.queryParams,timeoutMs:((g=(h=a==null?void 0:a.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=a==null?void 0:a.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:a==null?void 0:a.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:void 0,rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"DELETE","/v1/private/datasets/{id}/versions/{versionHash}/tags/{tag}")}listDatasetVersions(o,e={},t){return _.fromPromise(this.__listDatasetVersions(o,e,t))}async __listDatasetVersions(o,e={},t){var c,d,m,f,u,h,g,x,T,v,E;let{page:i,size:a}=e,s={page:i,size:a},p=z((c=this._options)==null?void 0:c.headers,P({"Comet-Workspace":(m=t==null?void 0:t.workspaceName)!=null?m:(d=this._options)==null?void 0:d.workspaceName}),t==null?void 0:t.headers),l=await k({url:R.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/versions`),method:"GET",headers:p,queryParameters:{...s,...t==null?void 0:t.queryParams},timeoutMs:((x=(g=t==null?void 0:t.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?x:60)*1e3,maxRetries:(v=t==null?void 0:t.maxRetries)!=null?v:(T=this._options)==null?void 0:T.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(E=this._options)==null?void 0:E.fetch,logging:this._options.logging});if(l.ok)return {data:fm.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")throw l.error.statusCode===400?new D(l.error.body,l.rawResponse):new w({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse});return A(l.error,l.rawResponse,"GET","/v1/private/datasets/{id}/versions")}restoreDatasetVersion(o,e,t){return _.fromPromise(this.__restoreDatasetVersion(o,e,t))}async __restoreDatasetVersion(o,e,t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/versions/restore`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:At.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:br.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"POST","/v1/private/datasets/{id}/versions/restore")}updateDatasetVersion(o,e,t={},i){return _.fromPromise(this.__updateDatasetVersion(o,e,t,i))}async __updateDatasetVersion(o,e,t={},i){var p,l,c,d,m,f,u,h,g,x,T;let a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=i==null?void 0:i.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),i==null?void 0:i.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/versions/hash/${R.encodePathParam(e)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:i==null?void 0:i.queryParams,requestType:"json",body:vt.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=i==null?void 0:i.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=i==null?void 0:i.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:i==null?void 0:i.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:br.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new D(s.error.body,s.rawResponse);case 404:throw new I(s.error.body,s.rawResponse);case 409:throw new $(s.error.body,s.rawResponse);default:throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return A(s.error,s.rawResponse,"PATCH","/v1/private/datasets/{id}/versions/hash/{versionHash}")}};var Xa=class{constructor(o={}){this._options=F(o);}batchUpdateExperiments(o,e){return _.fromPromise(this.__batchUpdateExperiments(o,e))}async __batchUpdateExperiments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/batch"),method:"PATCH",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:It.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PATCH","/v1/private/experiments/batch")}findExperiments(o={},e){return _.fromPromise(this.__findExperiments(o,e))}async __findExperiments(o={},e){var T,v,E,C,U,M,X,ie,ze,ke,Ve;let{page:t,size:i,datasetId:a,optimizationId:s,types:p,name:l,datasetDeleted:c,promptId:d,sorting:m,filters:f,experimentIds:u}=o,h={page:t,size:i,datasetId:a,optimization_id:s,types:p,name:l,dataset_deleted:c,prompt_id:d,sorting:m,filters:f,experiment_ids:u},g=z((T=this._options)==null?void 0:T.headers,P({"Comet-Workspace":(E=e==null?void 0:e.workspaceName)!=null?E:(v=this._options)==null?void 0:v.workspaceName}),e==null?void 0:e.headers),x=await k({url:R.join((U=(C=await b.get(this._options.baseUrl))!=null?C:await b.get(this._options.environment))!=null?U:S.Default,"v1/private/experiments"),method:"GET",headers:g,queryParameters:{...h,...e==null?void 0:e.queryParams},timeoutMs:((ie=(X=e==null?void 0:e.timeoutInSeconds)!=null?X:(M=this._options)==null?void 0:M.timeoutInSeconds)!=null?ie:60)*1e3,maxRetries:(ke=e==null?void 0:e.maxRetries)!=null?ke:(ze=this._options)==null?void 0:ze.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(Ve=this._options)==null?void 0:Ve.fetch,logging:this._options.logging});if(x.ok)return {data:Cm.parseOrThrow(x.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:x.rawResponse};if(x.error.reason==="status-code")throw x.error.statusCode===400?new D(x.error.body,x.rawResponse):new w({statusCode:x.error.statusCode,body:x.error.body,rawResponse:x.rawResponse});return A(x.error,x.rawResponse,"GET","/v1/private/experiments")}createExperiment(o,e){return _.fromPromise(this.__createExperiment(o,e))}async __createExperiment(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Vt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments")}createExperimentItems(o,e){return _.fromPromise(this.__createExperimentItems(o,e))}async __createExperimentItems(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/items"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Mt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments/items")}deleteExperimentItems(o,e){return _.fromPromise(this.__deleteExperimentItems(o,e))}async __deleteExperimentItems(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/items/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Wt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments/items/delete")}deleteExperimentsById(o,e){return _.fromPromise(this.__deleteExperimentsById(o,e))}async __deleteExperimentsById(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Hr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments/delete")}experimentItemsBulk(o,e){return _.fromPromise(this.__experimentItemsBulk(o,e))}async __experimentItemsBulk(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/items/bulk"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ut.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 409:throw new $(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"PUT","/v1/private/experiments/items/bulk")}findFeedbackScoreNames(o={},e){return _.fromPromise(this.__findFeedbackScoreNames(o,e))}async __findFeedbackScoreNames(o={},e){var p,l,c,d,m,f,u,h,g,x,T;let{experimentIds:t}=o,i={experiment_ids:t},a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=e==null?void 0:e.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),e==null?void 0:e.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,"v1/private/experiments/feedback-scores/names"),method:"GET",headers:a,queryParameters:{...i,...e==null?void 0:e.queryParams},timeoutMs:((h=(u=e==null?void 0:e.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=e==null?void 0:e.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:Dr.findFeedbackScoreNames.Response.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/experiments/feedback-scores/names")}findExperimentGroups(o={},e){return _.fromPromise(this.__findExperimentGroups(o,e))}async __findExperimentGroups(o={},e){var d,m,f,u,h,g,x,T,v,E,C;let{groups:t,types:i,name:a,filters:s}=o,p={groups:t,types:i,name:a,filters:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/private/experiments/groups"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:km.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw c.error.statusCode===400?new D(c.error.body,c.rawResponse):new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});return A(c.error,c.rawResponse,"GET","/v1/private/experiments/groups")}findExperimentGroupsAggregations(o={},e){return _.fromPromise(this.__findExperimentGroupsAggregations(o,e))}async __findExperimentGroupsAggregations(o={},e){var d,m,f,u,h,g,x,T,v,E,C;let{groups:t,types:i,name:a,filters:s}=o,p={groups:t,types:i,name:a,filters:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/private/experiments/groups/aggregations"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:Rm.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw c.error.statusCode===400?new D(c.error.body,c.rawResponse):new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});return A(c.error,c.rawResponse,"GET","/v1/private/experiments/groups/aggregations")}finishExperiments(o,e){return _.fromPromise(this.__finishExperiments(o,e))}async __finishExperiments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/finish"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Hr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments/finish")}getExperimentById(o,e={},t){return _.fromPromise(this.__getExperimentById(o,e,t))}async __getExperimentById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/experiments/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:ei.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/experiments/{id}")}updateExperiment(o,e,t){return _.fromPromise(this.__updateExperiment(o,e,t))}async __updateExperiment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/experiments/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Ct.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new D(s.error.body,s.rawResponse);case 404:throw new I(s.error.body,s.rawResponse);default:throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return A(s.error,s.rawResponse,"PATCH","/v1/private/experiments/{id}")}getExperimentItemById(o,e={},t){return _.fromPromise(this.__getExperimentItemById(o,e,t))}async __getExperimentItemById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/experiments/items/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Go.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/experiments/items/{id}")}streamExperimentItems(o,e){return _.fromPromise(this.__streamExperimentItems(o,e))}async __streamExperimentItems(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/items/stream"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ft.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),responseType:"streaming",timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:i.body,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments/items/stream")}streamExperiments(o,e){return _.fromPromise(this.__streamExperiments(o,e))}async __streamExperiments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/stream"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Bt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),responseType:"streaming",timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:i.body,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments/stream")}};var Za=class{constructor(o={}){this._options=F(o);}findFeedbackDefinitions(o={},e){return _.fromPromise(this.__findFeedbackDefinitions(o,e))}async __findFeedbackDefinitions(o={},e){var d,m,f,u,h,g,x,T,v,E,C;let{page:t,size:i,name:a,type:s}=o,p={page:t,size:i,name:a,type:s!=null?la.jsonOrThrow(s,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/private/feedback-definitions"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:Hm.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});return A(c.error,c.rawResponse,"GET","/v1/private/feedback-definitions")}createFeedbackDefinition(o,e){return _.fromPromise(this.__createFeedbackDefinition(o,e))}async __createFeedbackDefinition(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/feedback-definitions"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Wm.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/feedback-definitions")}getFeedbackDefinitionById(o,e={},t){return _.fromPromise(this.__getFeedbackDefinitionById(o,e,t))}async __getFeedbackDefinitionById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/feedback-definitions/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Gm.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/feedback-definitions/{id}")}updateFeedbackDefinition(o,e,t){return _.fromPromise(this.__updateFeedbackDefinition(o,e,t))}async __updateFeedbackDefinition(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/feedback-definitions/${R.encodePathParam(o)}`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:od.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PUT","/v1/private/feedback-definitions/{id}")}deleteFeedbackDefinitionById(o,e={},t){return _.fromPromise(this.__deleteFeedbackDefinitionById(o,e,t))}async __deleteFeedbackDefinitionById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/feedback-definitions/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===409?new $(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/feedback-definitions/{id}")}deleteFeedbackDefinitionsBatch(o,e){return _.fromPromise(this.__deleteFeedbackDefinitionsBatch(o,e))}async __deleteFeedbackDefinitionsBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/feedback-definitions/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===409?new $(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/feedback-definitions/delete")}};var Oa=class{constructor(o={}){this._options=F(o);}createGuardrails(o,e){return _.fromPromise(this.__createGuardrails(o,e))}async __createGuardrails(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/guardrails"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Lt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/guardrails")}};var qa=class{constructor(o={}){this._options=F(o);}deleteLlmProviderApiKeysBatch(o,e){return _.fromPromise(this.__deleteLlmProviderApiKeysBatch(o,e))}async __deleteLlmProviderApiKeysBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/llm-provider-key/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/llm-provider-key/delete")}findLlmProviderKeys(o){return _.fromPromise(this.__findLlmProviderKeys(o))}async __findLlmProviderKeys(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/llm-provider-key"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:gu.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/private/llm-provider-key")}storeLlmProviderApiKey(o,e){return _.fromPromise(this.__storeLlmProviderApiKey(o,e))}async __storeLlmProviderApiKey(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/llm-provider-key"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Jt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 401:throw new re(i.error.body,i.rawResponse);case 403:throw new ne(de.parseOrThrow(i.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/llm-provider-key")}getLlmProviderApiKeyById(o,e={},t){return _.fromPromise(this.__getLlmProviderApiKeyById(o,e,t))}async __getLlmProviderApiKeyById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/llm-provider-key/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:si.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/llm-provider-key/{id}")}updateLlmProviderApiKey(o,e={},t){return _.fromPromise(this.__updateLlmProviderApiKey(o,e,t))}async __updateLlmProviderApiKey(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/llm-provider-key/${R.encodePathParam(o)}`),method:"PATCH",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Ht.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 401:throw new re(a.error.body,a.rawResponse);case 403:throw new ne(de.parseOrThrow(a.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),a.rawResponse);case 404:throw new I(a.error.body,a.rawResponse);default:throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}return A(a.error,a.rawResponse,"PATCH","/v1/private/llm-provider-key/{id}")}};var en=class{constructor(o={}){this._options=F(o);}evaluateSpans(o,e){return _.fromPromise(this.__evaluateSpans(o,e))}async __evaluateSpans(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/manual-evaluation/spans"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:oi.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:ii.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 404:throw new I(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/manual-evaluation/spans")}evaluateThreads(o,e){return _.fromPromise(this.__evaluateThreads(o,e))}async __evaluateThreads(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/manual-evaluation/threads"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:oi.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:ii.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 404:throw new I(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/manual-evaluation/threads")}evaluateTraces(o,e){return _.fromPromise(this.__evaluateTraces(o,e))}async __evaluateTraces(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/manual-evaluation/traces"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:oi.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:ii.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 404:throw new I(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/manual-evaluation/traces")}};var rn=class{constructor(o={}){this._options=F(o);}receiveProtobufTraces(o){return _.fromPromise(this.__receiveProtobufTraces(o))}async __receiveProtobufTraces(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/otel/v1/traces"),method:"POST",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:t.body,rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"POST","/v1/private/otel/v1/traces")}};var tn=class{constructor(o={}){this._options=F(o);}cancelStudioOptimizations(o,e={},t){return _.fromPromise(this.__cancelStudioOptimizations(o,e,t))}async __cancelStudioOptimizations(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/optimizations/studio/${R.encodePathParam(o)}/cancel`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===501?new qe(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/optimizations/studio/{id}/cancel")}findOptimizations(o={},e){return _.fromPromise(this.__findOptimizations(o,e))}async __findOptimizations(o={},e){var f,u,h,g,x,T,v,E,C,U,M;let{page:t,size:i,datasetId:a,name:s,datasetDeleted:p,filters:l}=o,c={page:t,size:i,dataset_id:a,name:s,dataset_deleted:p,filters:l},d=z((f=this._options)==null?void 0:f.headers,P({"Comet-Workspace":(h=e==null?void 0:e.workspaceName)!=null?h:(u=this._options)==null?void 0:u.workspaceName}),e==null?void 0:e.headers),m=await k({url:R.join((x=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?x:S.Default,"v1/private/optimizations"),method:"GET",headers:d,queryParameters:{...c,...e==null?void 0:e.queryParams},timeoutMs:((E=(v=e==null?void 0:e.timeoutInSeconds)!=null?v:(T=this._options)==null?void 0:T.timeoutInSeconds)!=null?E:60)*1e3,maxRetries:(U=e==null?void 0:e.maxRetries)!=null?U:(C=this._options)==null?void 0:C.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(M=this._options)==null?void 0:M.fetch,logging:this._options.logging});if(m.ok)return {data:Td.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")throw m.error.statusCode===400?new D(m.error.body,m.rawResponse):new w({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse});return A(m.error,m.rawResponse,"GET","/v1/private/optimizations")}createOptimization(o,e){return _.fromPromise(this.__createOptimization(o,e))}async __createOptimization(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/optimizations"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Wa.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/optimizations")}upsertOptimization(o,e){return _.fromPromise(this.__upsertOptimization(o,e))}async __upsertOptimization(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/optimizations"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Wa.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/optimizations")}deleteOptimizationsById(o,e){return _.fromPromise(this.__deleteOptimizationsById(o,e))}async __deleteOptimizationsById(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/optimizations/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Hr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/optimizations/delete")}getOptimizationById(o,e={},t){return _.fromPromise(this.__getOptimizationById(o,e,t))}async __getOptimizationById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/optimizations/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:ai.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/optimizations/{id}")}updateOptimizationsById(o,e={},t){return _.fromPromise(this.__updateOptimizationsById(o,e,t))}async __updateOptimizationsById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/optimizations/${R.encodePathParam(o)}`),method:"PUT",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Gt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"PUT","/v1/private/optimizations/{id}")}getStudioOptimizationLogs(o,e={},t){return _.fromPromise(this.__getStudioOptimizationLogs(o,e,t))}async __getStudioOptimizationLogs(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/optimizations/studio/${R.encodePathParam(o)}/logs`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Fd.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/optimizations/studio/{id}/logs")}};var on=class{constructor(o={}){this._options=F(o);}findProjects(o={},e){return _.fromPromise(this.__findProjects(o,e))}async __findProjects(o={},e){var d,m,f,u,h,g,x,T,v,E,C;let{page:t,size:i,name:a,sorting:s}=o,p={page:t,size:i,name:a,sorting:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/private/projects"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:Yd.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});return A(c.error,c.rawResponse,"GET","/v1/private/projects")}createProject(o,e){return _.fromPromise(this.__createProject(o,e))}async __createProject(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/projects"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Yt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/projects")}getProjectById(o,e={},t){return _.fromPromise(this.__getProjectById(o,e,t))}async __getProjectById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/projects/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:ni.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/projects/{id}")}deleteProjectById(o,e={},t){return _.fromPromise(this.__deleteProjectById(o,e,t))}async __deleteProjectById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/projects/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===409?new $(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/projects/{id}")}updateProject(o,e={},t){return _.fromPromise(this.__updateProject(o,e,t))}async __updateProject(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/projects/${R.encodePathParam(o)}`),method:"PATCH",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Qt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new D(a.error.body,a.rawResponse);case 422:throw new Z(a.error.body,a.rawResponse);default:throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}return A(a.error,a.rawResponse,"PATCH","/v1/private/projects/{id}")}deleteProjectsBatch(o,e){return _.fromPromise(this.__deleteProjectsBatch(o,e))}async __deleteProjectsBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/projects/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/projects/delete")}findFeedbackScoreNamesByProjectIds(o={},e){return _.fromPromise(this.__findFeedbackScoreNamesByProjectIds(o,e))}async __findFeedbackScoreNamesByProjectIds(o={},e){var p,l,c,d,m,f,u,h,g,x,T;let{projectIds:t}=o,i={project_ids:t},a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=e==null?void 0:e.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),e==null?void 0:e.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,"v1/private/projects/feedback-scores/names"),method:"GET",headers:a,queryParameters:{...i,...e==null?void 0:e.queryParams},timeoutMs:((h=(u=e==null?void 0:e.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=e==null?void 0:e.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:Xm.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/projects/feedback-scores/names")}getProjectMetrics(o,e={},t){return _.fromPromise(this.__getProjectMetrics(o,e,t))}async __getProjectMetrics(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/projects/${R.encodePathParam(o)}/metrics`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Kt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:$d.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new D(a.error.body,a.rawResponse);case 404:throw new I(a.error.body,a.rawResponse);default:throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}return A(a.error,a.rawResponse,"POST","/v1/private/projects/{id}/metrics")}getProjectStats(o={},e){return _.fromPromise(this.__getProjectStats(o,e))}async __getProjectStats(o={},e){var d,m,f,u,h,g,x,T,v,E,C;let{page:t,size:i,name:a,sorting:s}=o,p={page:t,size:i,name:a,sorting:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/private/projects/stats"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:qd.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});return A(c.error,c.rawResponse,"GET","/v1/private/projects/stats")}retrieveProject(o,e){return _.fromPromise(this.__retrieveProject(o,e))}async __retrieveProject(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/projects/retrieve"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:$t.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Hd.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 404:throw new I(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/projects/retrieve")}};var an=class{constructor(o={}){this._options=F(o);}getPrompts(o={},e){return _.fromPromise(this.__getPrompts(o,e))}async __getPrompts(o={},e){var m,f,u,h,g,x,T,v,E,C,U;let{page:t,size:i,name:a,sorting:s,filters:p}=o,l={page:t,size:i,name:a,sorting:s,filters:p},c=z((m=this._options)==null?void 0:m.headers,P({"Comet-Workspace":(u=e==null?void 0:e.workspaceName)!=null?u:(f=this._options)==null?void 0:f.workspaceName}),e==null?void 0:e.headers),d=await k({url:R.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:S.Default,"v1/private/prompts"),method:"GET",headers:c,queryParameters:{...l,...e==null?void 0:e.queryParams},timeoutMs:((v=(T=e==null?void 0:e.timeoutInSeconds)!=null?T:(x=this._options)==null?void 0:x.timeoutInSeconds)!=null?v:60)*1e3,maxRetries:(C=e==null?void 0:e.maxRetries)!=null?C:(E=this._options)==null?void 0:E.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(U=this._options)==null?void 0:U.fetch,logging:this._options.logging});if(d.ok)return {data:cu.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")throw new w({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse});return A(d.error,d.rawResponse,"GET","/v1/private/prompts")}createPrompt(o,e){return _.fromPromise(this.__createPrompt(o,e))}async __createPrompt(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/prompts"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:eo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 409:throw new $(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/prompts")}createPromptVersion(o,e){return _.fromPromise(this.__createPromptVersion(o,e))}async __createPromptVersion(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/prompts/versions"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Xt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Ee.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 409:throw new $(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/prompts/versions")}updatePromptVersions(o,e){return _.fromPromise(this.__updatePromptVersions(o,e))}async __updatePromptVersions(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/prompts/versions"),method:"PATCH",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ot.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PATCH","/v1/private/prompts/versions")}getPromptById(o,e={},t){return _.fromPromise(this.__getPromptById(o,e,t))}async __getPromptById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/prompts/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:nu.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/prompts/{id}")}updatePrompt(o,e,t){return _.fromPromise(this.__updatePrompt(o,e,t))}async __updatePrompt(o,e,t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/prompts/${R.encodePathParam(o)}`),method:"PUT",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Zt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new D(a.error.body,a.rawResponse);case 404:throw new I(a.error.body,a.rawResponse);case 409:throw new $(a.error.body,a.rawResponse);case 422:throw new Z(a.error.body,a.rawResponse);default:throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}return A(a.error,a.rawResponse,"PUT","/v1/private/prompts/{id}")}deletePrompt(o,e={},t){return _.fromPromise(this.__deletePrompt(o,e,t))}async __deletePrompt(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/prompts/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/prompts/{id}")}deletePromptsBatch(o,e){return _.fromPromise(this.__deletePromptsBatch(o,e))}async __deletePromptsBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/prompts/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/prompts/delete")}getPromptVersionById(o,e={},t){return _.fromPromise(this.__getPromptVersionById(o,e,t))}async __getPromptVersionById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/prompts/versions/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Ee.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/prompts/versions/{versionId}")}getPromptVersions(o,e={},t){return _.fromPromise(this.__getPromptVersions(o,e,t))}async __getPromptVersions(o,e={},t){var f,u,h,g,x,T,v,E,C,U,M;let{page:i,size:a,search:s,sorting:p,filters:l}=e,c={page:i,size:a,search:s,sorting:p,filters:l},d=z((f=this._options)==null?void 0:f.headers,P({"Comet-Workspace":(h=t==null?void 0:t.workspaceName)!=null?h:(u=this._options)==null?void 0:u.workspaceName}),t==null?void 0:t.headers),m=await k({url:R.join((x=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?x:S.Default,`v1/private/prompts/${R.encodePathParam(o)}/versions`),method:"GET",headers:d,queryParameters:{...c,...t==null?void 0:t.queryParams},timeoutMs:((E=(v=t==null?void 0:t.timeoutInSeconds)!=null?v:(T=this._options)==null?void 0:T.timeoutInSeconds)!=null?E:60)*1e3,maxRetries:(U=t==null?void 0:t.maxRetries)!=null?U:(C=this._options)==null?void 0:C.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(M=this._options)==null?void 0:M.fetch,logging:this._options.logging});if(m.ok)return {data:uu.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")throw new w({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse});return A(m.error,m.rawResponse,"GET","/v1/private/prompts/{id}/versions")}restorePromptVersion(o,e,t={},i){return _.fromPromise(this.__restorePromptVersion(o,e,t,i))}async __restorePromptVersion(o,e,t={},i){var p,l,c,d,m,f,u,h,g,x,T;let a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=i==null?void 0:i.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),i==null?void 0:i.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/prompts/${R.encodePathParam(o)}/versions/${R.encodePathParam(e)}/restore`),method:"POST",headers:a,queryParameters:i==null?void 0:i.queryParams,timeoutMs:((h=(u=i==null?void 0:i.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=i==null?void 0:i.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:i==null?void 0:i.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:Ee.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new D(s.error.body,s.rawResponse);case 404:throw new I(s.error.body,s.rawResponse);default:throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return A(s.error,s.rawResponse,"POST","/v1/private/prompts/{promptId}/versions/{versionId}/restore")}retrievePromptVersion(o,e){return _.fromPromise(this.__retrievePromptVersion(o,e))}async __retrievePromptVersion(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/prompts/versions/retrieve"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:qt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Ee.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 404:throw new I(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/prompts/versions/retrieve")}};var nn=class{constructor(o={}){this._options=F(o);}datasetsRedirect(o,e){return _.fromPromise(this.__datasetsRedirect(o,e))}async __datasetsRedirect(o,e){var c,d,m,f,u,h,g,x,T,v,E;let{datasetId:t,workspaceName:i,path:a}=o,s={dataset_id:t,workspace_name:i,path:a},p=z((c=this._options)==null?void 0:c.headers,P({"Comet-Workspace":(m=e==null?void 0:e.workspaceName)!=null?m:(d=this._options)==null?void 0:d.workspaceName}),e==null?void 0:e.headers),l=await k({url:R.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:S.Default,"v1/session/redirect/datasets"),method:"GET",headers:p,queryParameters:{...s,...e==null?void 0:e.queryParams},timeoutMs:((x=(g=e==null?void 0:e.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?x:60)*1e3,maxRetries:(v=e==null?void 0:e.maxRetries)!=null?v:(T=this._options)==null?void 0:T.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(E=this._options)==null?void 0:E.fetch,logging:this._options.logging});if(l.ok)return {data:void 0,rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new D(l.error.body,l.rawResponse);case 404:throw new I(l.error.body,l.rawResponse);default:throw new w({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return A(l.error,l.rawResponse,"GET","/v1/session/redirect/datasets")}experimentsRedirect(o,e){return _.fromPromise(this.__experimentsRedirect(o,e))}async __experimentsRedirect(o,e){var d,m,f,u,h,g,x,T,v,E,C;let{datasetId:t,experimentId:i,workspaceName:a,path:s}=o,p={dataset_id:t,experiment_id:i,workspace_name:a,path:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/session/redirect/experiments"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:void 0,rawResponse:c.rawResponse};if(c.error.reason==="status-code")switch(c.error.statusCode){case 400:throw new D(c.error.body,c.rawResponse);case 404:throw new I(c.error.body,c.rawResponse);default:throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse})}return A(c.error,c.rawResponse,"GET","/v1/session/redirect/experiments")}optimizationsRedirect(o,e){return _.fromPromise(this.__optimizationsRedirect(o,e))}async __optimizationsRedirect(o,e){var d,m,f,u,h,g,x,T,v,E,C;let{datasetId:t,optimizationId:i,workspaceName:a,path:s}=o,p={dataset_id:t,optimization_id:i,workspace_name:a,path:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/session/redirect/optimizations"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:void 0,rawResponse:c.rawResponse};if(c.error.reason==="status-code")switch(c.error.statusCode){case 400:throw new D(c.error.body,c.rawResponse);case 404:throw new I(c.error.body,c.rawResponse);default:throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse})}return A(c.error,c.rawResponse,"GET","/v1/session/redirect/optimizations")}projectsRedirect(o,e){return _.fromPromise(this.__projectsRedirect(o,e))}async __projectsRedirect(o,e){var c,d,m,f,u,h,g,x,T,v,E;let{traceId:t,workspaceName:i,path:a}=o,s={trace_id:t,workspace_name:i,path:a},p=z((c=this._options)==null?void 0:c.headers,P({"Comet-Workspace":(m=e==null?void 0:e.workspaceName)!=null?m:(d=this._options)==null?void 0:d.workspaceName}),e==null?void 0:e.headers),l=await k({url:R.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:S.Default,"v1/session/redirect/projects"),method:"GET",headers:p,queryParameters:{...s,...e==null?void 0:e.queryParams},timeoutMs:((x=(g=e==null?void 0:e.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?x:60)*1e3,maxRetries:(v=e==null?void 0:e.maxRetries)!=null?v:(T=this._options)==null?void 0:T.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(E=this._options)==null?void 0:E.fetch,logging:this._options.logging});if(l.ok)return {data:void 0,rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new D(l.error.body,l.rawResponse);case 404:throw new I(l.error.body,l.rawResponse);default:throw new w({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return A(l.error,l.rawResponse,"GET","/v1/session/redirect/projects")}};var sn=class{constructor(o={}){this._options=F(o);}getServiceToggles(o){return _.fromPromise(this.__getServiceToggles(o))}async __getServiceToggles(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/toggles"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:yu.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/private/toggles")}};var pn=class{constructor(o={}){this._options=F(o);}addSpanComment(o,e,t){return _.fromPromise(this.__addSpanComment(o,e,t))}async __addSpanComment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/spans/${R.encodePathParam(o)}/comments`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:O.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/spans/{id}/comments")}addSpanFeedbackScore(o,e,t){return _.fromPromise(this.__addSpanFeedbackScore(o,e,t))}async __addSpanFeedbackScore(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/spans/${R.encodePathParam(o)}/feedback-scores`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:se.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PUT","/v1/private/spans/{id}/feedback-scores")}createSpans(o,e){return _.fromPromise(this.__createSpans(o,e))}async __createSpans(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/spans/batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ao.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/spans/batch")}batchUpdateSpans(o,e){return _.fromPromise(this.__batchUpdateSpans(o,e))}async __batchUpdateSpans(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/spans/batch"),method:"PATCH",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:to.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PATCH","/v1/private/spans/batch")}getSpansByProject(o={},e){return _.fromPromise(this.__getSpansByProject(o,e))}async __getSpansByProject(o={},e){var E,C,U,M,X,ie,ze,ke,Ve,Xu,Zu;let{page:t,size:i,projectName:a,projectId:s,traceId:p,type:l,filters:c,truncate:d,stripAttachments:m,sorting:f,exclude:u,fromTime:h,toTime:g}=o,x={page:t,size:i,project_name:a,project_id:s,trace_id:p,type:l!=null?ja.jsonOrThrow(l,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0,filters:c,truncate:d,strip_attachments:m,sorting:f,exclude:u,from_time:h==null?void 0:h.toISOString(),to_time:g==null?void 0:g.toISOString()},T=z((E=this._options)==null?void 0:E.headers,P({"Comet-Workspace":(U=e==null?void 0:e.workspaceName)!=null?U:(C=this._options)==null?void 0:C.workspaceName}),e==null?void 0:e.headers),v=await k({url:R.join((X=(M=await b.get(this._options.baseUrl))!=null?M:await b.get(this._options.environment))!=null?X:S.Default,"v1/private/spans"),method:"GET",headers:T,queryParameters:{...x,...e==null?void 0:e.queryParams},timeoutMs:((ke=(ze=e==null?void 0:e.timeoutInSeconds)!=null?ze:(ie=this._options)==null?void 0:ie.timeoutInSeconds)!=null?ke:60)*1e3,maxRetries:(Xu=e==null?void 0:e.maxRetries)!=null?Xu:(Ve=this._options)==null?void 0:Ve.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(Zu=this._options)==null?void 0:Zu.fetch,logging:this._options.logging});if(v.ok)return {data:xu.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")throw new w({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse});return A(v.error,v.rawResponse,"GET","/v1/private/spans")}createSpan(o,e){return _.fromPromise(this.__createSpan(o,e))}async __createSpan(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/spans"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:io.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===409?new $(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/spans")}getSpanById(o,e={},t){return _.fromPromise(this.__getSpanById(o,e,t))}async __getSpanById(o,e={},t){var l,c,d,m,f,u,h,g,x,T,v;let{stripAttachments:i}=e,a={strip_attachments:i},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=t==null?void 0:t.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),t==null?void 0:t.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,`v1/private/spans/${R.encodePathParam(o)}`),method:"GET",headers:s,queryParameters:{...a,...t==null?void 0:t.queryParams},timeoutMs:((g=(h=t==null?void 0:t.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=t==null?void 0:t.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:pi.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw p.error.statusCode===404?new I(p.error.body,p.rawResponse):new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"GET","/v1/private/spans/{id}")}deleteSpanById(o,e={},t){return _.fromPromise(this.__deleteSpanById(o,e,t))}async __deleteSpanById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/spans/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===501?new qe(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/spans/{id}")}updateSpan(o,e,t){return _.fromPromise(this.__updateSpan(o,e,t))}async __updateSpan(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/spans/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ro.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/spans/{id}")}deleteSpanComments(o,e){return _.fromPromise(this.__deleteSpanComments(o,e))}async __deleteSpanComments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/spans/comments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/spans/comments/delete")}deleteSpanFeedbackScore(o,e,t){return _.fromPromise(this.__deleteSpanFeedbackScore(o,e,t))}async __deleteSpanFeedbackScore(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/spans/${R.encodePathParam(o)}/feedback-scores/delete`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Qo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/spans/{id}/feedback-scores/delete")}findFeedbackScoreNames1(o={},e){return _.fromPromise(this.__findFeedbackScoreNames1(o,e))}async __findFeedbackScoreNames1(o={},e){var l,c,d,m,f,u,h,g,x,T,v;let{projectId:t,type:i}=o,a={project_id:t,type:i!=null?Ta.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=e==null?void 0:e.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),e==null?void 0:e.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,"v1/private/spans/feedback-scores/names"),method:"GET",headers:s,queryParameters:{...a,...e==null?void 0:e.queryParams},timeoutMs:((g=(h=e==null?void 0:e.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=e==null?void 0:e.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:Ur.findFeedbackScoreNames1.Response.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"GET","/v1/private/spans/feedback-scores/names")}getSpanComment(o,e,t={},i){return _.fromPromise(this.__getSpanComment(o,e,t,i))}async __getSpanComment(o,e,t={},i){var p,l,c,d,m,f,u,h,g,x,T;let a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=i==null?void 0:i.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),i==null?void 0:i.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/spans/${R.encodePathParam(o)}/comments/${R.encodePathParam(e)}`),method:"GET",headers:a,queryParameters:i==null?void 0:i.queryParams,timeoutMs:((h=(u=i==null?void 0:i.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=i==null?void 0:i.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:i==null?void 0:i.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:O.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/spans/{spanId}/comments/{commentId}")}getSpanStats(o={},e){return _.fromPromise(this.__getSpanStats(o,e))}async __getSpanStats(o={},e){var u,h,g,x,T,v,E,C,U,M,X;let{projectId:t,projectName:i,traceId:a,type:s,filters:p,fromTime:l,toTime:c}=o,d={project_id:t,project_name:i,trace_id:a,type:s!=null?va.jsonOrThrow(s,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0,filters:p,from_time:l==null?void 0:l.toISOString(),to_time:c==null?void 0:c.toISOString()},m=z((u=this._options)==null?void 0:u.headers,P({"Comet-Workspace":(g=e==null?void 0:e.workspaceName)!=null?g:(h=this._options)==null?void 0:h.workspaceName}),e==null?void 0:e.headers),f=await k({url:R.join((T=(x=await b.get(this._options.baseUrl))!=null?x:await b.get(this._options.environment))!=null?T:S.Default,"v1/private/spans/stats"),method:"GET",headers:m,queryParameters:{...d,...e==null?void 0:e.queryParams},timeoutMs:((C=(E=e==null?void 0:e.timeoutInSeconds)!=null?E:(v=this._options)==null?void 0:v.timeoutInSeconds)!=null?C:60)*1e3,maxRetries:(M=e==null?void 0:e.maxRetries)!=null?M:(U=this._options)==null?void 0:U.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(X=this._options)==null?void 0:X.fetch,logging:this._options.logging});if(f.ok)return {data:Je.parseOrThrow(f.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:f.rawResponse};if(f.error.reason==="status-code")throw new w({statusCode:f.error.statusCode,body:f.error.body,rawResponse:f.rawResponse});return A(f.error,f.rawResponse,"GET","/v1/private/spans/stats")}scoreBatchOfSpans(o,e){return _.fromPromise(this.__scoreBatchOfSpans(o,e))}async __scoreBatchOfSpans(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/spans/feedback-scores"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ti.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/spans/feedback-scores")}searchSpans(o={},e){return _.fromPromise(this.__searchSpans(o,e))}async __searchSpans(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/spans/search"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:no.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),responseType:"streaming",timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:i.body,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/spans/search")}updateSpanComment(o,e,t){return _.fromPromise(this.__updateSpanComment(o,e,t))}async __updateSpanComment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/spans/comments/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:O.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/spans/comments/{commentId}")}};var cn=class{constructor(o={}){this._options=F(o);}getDatasetBiInfo(o){return _.fromPromise(this.__getDatasetBiInfo(o))}async __getDatasetBiInfo(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/internal/usage/bi-datasets"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Vr.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/internal/usage/bi-datasets")}getExperimentBiInfo(o){return _.fromPromise(this.__getExperimentBiInfo(o))}async __getExperimentBiInfo(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/internal/usage/bi-experiments"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Vr.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/internal/usage/bi-experiments")}getSpansBiInfo(o){return _.fromPromise(this.__getSpansBiInfo(o))}async __getSpansBiInfo(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/internal/usage/bi-spans"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Vr.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/internal/usage/bi-spans")}getSpansCountForWorkspaces(o){return _.fromPromise(this.__getSpansCountForWorkspaces(o))}async __getSpansCountForWorkspaces(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/internal/usage/workspace-span-counts"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:wu.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/internal/usage/workspace-span-counts")}getTracesBiInfo(o){return _.fromPromise(this.__getTracesBiInfo(o))}async __getTracesBiInfo(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/internal/usage/bi-traces"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Vr.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/internal/usage/bi-traces")}getTracesCountForWorkspaces(o){return _.fromPromise(this.__getTracesCountForWorkspaces(o))}async __getTracesCountForWorkspaces(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/internal/usage/workspace-trace-counts"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:ku.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/internal/usage/workspace-trace-counts")}};var ln=class{constructor(o={}){this._options=F(o);}addThreadComment(o,e,t){return _.fromPromise(this.__addThreadComment(o,e,t))}async __addThreadComment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/threads/${R.encodePathParam(o)}/comments`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:O.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/traces/threads/{id}/comments")}addTraceComment(o,e,t){return _.fromPromise(this.__addTraceComment(o,e,t))}async __addTraceComment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/${R.encodePathParam(o)}/comments`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:O.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/traces/{id}/comments")}addTraceFeedbackScore(o,e,t){return _.fromPromise(this.__addTraceFeedbackScore(o,e,t))}async __addTraceFeedbackScore(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/${R.encodePathParam(o)}/feedback-scores`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:se.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PUT","/v1/private/traces/{id}/feedback-scores")}createTraces(o,e){return _.fromPromise(this.__createTraces(o,e))}async __createTraces(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:fo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/batch")}batchUpdateTraces(o,e){return _.fromPromise(this.__batchUpdateTraces(o,e))}async __batchUpdateTraces(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/batch"),method:"PATCH",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:mo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PATCH","/v1/private/traces/batch")}batchUpdateThreads(o,e){return _.fromPromise(this.__batchUpdateThreads(o,e))}async __batchUpdateThreads(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/batch"),method:"PATCH",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:bo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PATCH","/v1/private/traces/threads/batch")}closeTraceThread(o={},e){return _.fromPromise(this.__closeTraceThread(o,e))}async __closeTraceThread(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/close"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:go.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===404?new I(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/traces/threads/close")}getTracesByProject(o={},e){return _.fromPromise(this.__getTracesByProject(o,e))}async __getTracesByProject(o={},e){var T,v,E,C,U,M,X,ie,ze,ke,Ve;let{page:t,size:i,projectName:a,projectId:s,filters:p,truncate:l,stripAttachments:c,sorting:d,exclude:m,fromTime:f,toTime:u}=o,h={page:t,size:i,project_name:a,project_id:s,filters:p,truncate:l,strip_attachments:c,sorting:d,exclude:m,from_time:f==null?void 0:f.toISOString(),to_time:u==null?void 0:u.toISOString()},g=z((T=this._options)==null?void 0:T.headers,P({"Comet-Workspace":(E=e==null?void 0:e.workspaceName)!=null?E:(v=this._options)==null?void 0:v.workspaceName}),e==null?void 0:e.headers),x=await k({url:R.join((U=(C=await b.get(this._options.baseUrl))!=null?C:await b.get(this._options.environment))!=null?U:S.Default,"v1/private/traces"),method:"GET",headers:g,queryParameters:{...h,...e==null?void 0:e.queryParams},timeoutMs:((ie=(X=e==null?void 0:e.timeoutInSeconds)!=null?X:(M=this._options)==null?void 0:M.timeoutInSeconds)!=null?ie:60)*1e3,maxRetries:(ke=e==null?void 0:e.maxRetries)!=null?ke:(ze=this._options)==null?void 0:ze.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(Ve=this._options)==null?void 0:Ve.fetch,logging:this._options.logging});if(x.ok)return {data:Pu.parseOrThrow(x.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:x.rawResponse};if(x.error.reason==="status-code")throw new w({statusCode:x.error.statusCode,body:x.error.body,rawResponse:x.rawResponse});return A(x.error,x.rawResponse,"GET","/v1/private/traces")}createTrace(o,e){return _.fromPromise(this.__createTrace(o,e))}async __createTrace(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:uo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces")}getTraceById(o,e={},t){return _.fromPromise(this.__getTraceById(o,e,t))}async __getTraceById(o,e={},t){var l,c,d,m,f,u,h,g,x,T,v;let{stripAttachments:i}=e,a={strip_attachments:i},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=t==null?void 0:t.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),t==null?void 0:t.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,`v1/private/traces/${R.encodePathParam(o)}`),method:"GET",headers:s,queryParameters:{...a,...t==null?void 0:t.queryParams},timeoutMs:((g=(h=t==null?void 0:t.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=t==null?void 0:t.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:ci.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"GET","/v1/private/traces/{id}")}deleteTraceById(o,e={},t){return _.fromPromise(this.__deleteTraceById(o,e,t))}async __deleteTraceById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/traces/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/traces/{id}")}updateTrace(o,e,t){return _.fromPromise(this.__updateTrace(o,e,t))}async __updateTrace(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:lo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/traces/{id}")}deleteThreadComments(o,e){return _.fromPromise(this.__deleteThreadComments(o,e))}async __deleteThreadComments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/comments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/threads/comments/delete")}deleteThreadFeedbackScores(o,e){return _.fromPromise(this.__deleteThreadFeedbackScores(o,e))}async __deleteThreadFeedbackScores(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/feedback-scores/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:so.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/threads/feedback-scores/delete")}deleteTraceComments(o,e){return _.fromPromise(this.__deleteTraceComments(o,e))}async __deleteTraceComments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/comments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/comments/delete")}deleteTraceFeedbackScore(o,e,t){return _.fromPromise(this.__deleteTraceFeedbackScore(o,e,t))}async __deleteTraceFeedbackScore(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/${R.encodePathParam(o)}/feedback-scores/delete`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Qo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/traces/{id}/feedback-scores/delete")}deleteTraceThreads(o,e){return _.fromPromise(this.__deleteTraceThreads(o,e))}async __deleteTraceThreads(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:po.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/threads/delete")}deleteTraces(o,e){return _.fromPromise(this.__deleteTraces(o,e))}async __deleteTraces(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/delete")}findFeedbackScoreNames2(o={},e){return _.fromPromise(this.__findFeedbackScoreNames2(o,e))}async __findFeedbackScoreNames2(o={},e){var p,l,c,d,m,f,u,h,g,x,T;let{projectId:t}=o,i={project_id:t},a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=e==null?void 0:e.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),e==null?void 0:e.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,"v1/private/traces/feedback-scores/names"),method:"GET",headers:a,queryParameters:{...i,...e==null?void 0:e.queryParams},timeoutMs:((h=(u=e==null?void 0:e.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=e==null?void 0:e.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:ar.findFeedbackScoreNames2.Response.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/traces/feedback-scores/names")}findTraceThreadsFeedbackScoreNames(o={},e){return _.fromPromise(this.__findTraceThreadsFeedbackScoreNames(o,e))}async __findTraceThreadsFeedbackScoreNames(o={},e){var p,l,c,d,m,f,u,h,g,x,T;let{projectId:t}=o,i={project_id:t},a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=e==null?void 0:e.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),e==null?void 0:e.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,"v1/private/traces/threads/feedback-scores/names"),method:"GET",headers:a,queryParameters:{...i,...e==null?void 0:e.queryParams},timeoutMs:((h=(u=e==null?void 0:e.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=e==null?void 0:e.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:ar.findTraceThreadsFeedbackScoreNames.Response.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/traces/threads/feedback-scores/names")}getTraceStats(o={},e){return _.fromPromise(this.__getTraceStats(o,e))}async __getTraceStats(o={},e){var m,f,u,h,g,x,T,v,E,C,U;let{projectId:t,projectName:i,filters:a,fromTime:s,toTime:p}=o,l={project_id:t,project_name:i,filters:a,from_time:s==null?void 0:s.toISOString(),to_time:p==null?void 0:p.toISOString()},c=z((m=this._options)==null?void 0:m.headers,P({"Comet-Workspace":(u=e==null?void 0:e.workspaceName)!=null?u:(f=this._options)==null?void 0:f.workspaceName}),e==null?void 0:e.headers),d=await k({url:R.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:S.Default,"v1/private/traces/stats"),method:"GET",headers:c,queryParameters:{...l,...e==null?void 0:e.queryParams},timeoutMs:((v=(T=e==null?void 0:e.timeoutInSeconds)!=null?T:(x=this._options)==null?void 0:x.timeoutInSeconds)!=null?v:60)*1e3,maxRetries:(C=e==null?void 0:e.maxRetries)!=null?C:(E=this._options)==null?void 0:E.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(U=this._options)==null?void 0:U.fetch,logging:this._options.logging});if(d.ok)return {data:Je.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")throw new w({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse});return A(d.error,d.rawResponse,"GET","/v1/private/traces/stats")}getThreadComment(o,e,t={},i){return _.fromPromise(this.__getThreadComment(o,e,t,i))}async __getThreadComment(o,e,t={},i){var p,l,c,d,m,f,u,h,g,x,T;let a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=i==null?void 0:i.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),i==null?void 0:i.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/threads/${R.encodePathParam(o)}/comments/${R.encodePathParam(e)}`),method:"GET",headers:a,queryParameters:i==null?void 0:i.queryParams,timeoutMs:((h=(u=i==null?void 0:i.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=i==null?void 0:i.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:i==null?void 0:i.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:O.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/traces/threads/{threadId}/comments/{commentId}")}getTraceThreadStats(o={},e){return _.fromPromise(this.__getTraceThreadStats(o,e))}async __getTraceThreadStats(o={},e){var m,f,u,h,g,x,T,v,E,C,U;let{projectId:t,projectName:i,filters:a,fromTime:s,toTime:p}=o,l={project_id:t,project_name:i,filters:a,from_time:s==null?void 0:s.toISOString(),to_time:p==null?void 0:p.toISOString()},c=z((m=this._options)==null?void 0:m.headers,P({"Comet-Workspace":(u=e==null?void 0:e.workspaceName)!=null?u:(f=this._options)==null?void 0:f.workspaceName}),e==null?void 0:e.headers),d=await k({url:R.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:S.Default,"v1/private/traces/threads/stats"),method:"GET",headers:c,queryParameters:{...l,...e==null?void 0:e.queryParams},timeoutMs:((v=(T=e==null?void 0:e.timeoutInSeconds)!=null?T:(x=this._options)==null?void 0:x.timeoutInSeconds)!=null?v:60)*1e3,maxRetries:(C=e==null?void 0:e.maxRetries)!=null?C:(E=this._options)==null?void 0:E.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(U=this._options)==null?void 0:U.fetch,logging:this._options.logging});if(d.ok)return {data:Je.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")throw new w({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse});return A(d.error,d.rawResponse,"GET","/v1/private/traces/threads/stats")}getTraceComment(o,e,t={},i){return _.fromPromise(this.__getTraceComment(o,e,t,i))}async __getTraceComment(o,e,t={},i){var p,l,c,d,m,f,u,h,g,x,T;let a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=i==null?void 0:i.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),i==null?void 0:i.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/${R.encodePathParam(o)}/comments/${R.encodePathParam(e)}`),method:"GET",headers:a,queryParameters:i==null?void 0:i.queryParams,timeoutMs:((h=(u=i==null?void 0:i.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=i==null?void 0:i.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:i==null?void 0:i.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:O.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/traces/{traceId}/comments/{commentId}")}getTraceThread(o,e){return _.fromPromise(this.__getTraceThread(o,e))}async __getTraceThread(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/retrieve"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ba.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:li.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===404?new I(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/threads/retrieve")}getTraceThreads(o={},e){return _.fromPromise(this.__getTraceThreads(o,e))}async __getTraceThreads(o={},e){var x,T,v,E,C,U,M,X,ie,ze,ke;let{page:t,size:i,projectName:a,projectId:s,truncate:p,stripAttachments:l,filters:c,sorting:d,fromTime:m,toTime:f}=o,u={page:t,size:i,project_name:a,project_id:s,truncate:p,strip_attachments:l,filters:c,sorting:d,from_time:m==null?void 0:m.toISOString(),to_time:f==null?void 0:f.toISOString()},h=z((x=this._options)==null?void 0:x.headers,P({"Comet-Workspace":(v=e==null?void 0:e.workspaceName)!=null?v:(T=this._options)==null?void 0:T.workspaceName}),e==null?void 0:e.headers),g=await k({url:R.join((C=(E=await b.get(this._options.baseUrl))!=null?E:await b.get(this._options.environment))!=null?C:S.Default,"v1/private/traces/threads"),method:"GET",headers:h,queryParameters:{...u,...e==null?void 0:e.queryParams},timeoutMs:((X=(M=e==null?void 0:e.timeoutInSeconds)!=null?M:(U=this._options)==null?void 0:U.timeoutInSeconds)!=null?X:60)*1e3,maxRetries:(ze=e==null?void 0:e.maxRetries)!=null?ze:(ie=this._options)==null?void 0:ie.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(ke=this._options)==null?void 0:ke.fetch,logging:this._options.logging});if(g.ok)return {data:Tu.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")throw new w({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse});return A(g.error,g.rawResponse,"GET","/v1/private/traces/threads")}openTraceThread(o,e){return _.fromPromise(this.__openTraceThread(o,e))}async __openTraceThread(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/open"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ba.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/traces/threads/open")}scoreBatchOfThreads(o,e){return _.fromPromise(this.__scoreBatchOfThreads(o,e))}async __scoreBatchOfThreads(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/feedback-scores"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:co.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/traces/threads/feedback-scores")}scoreBatchOfTraces(o,e){return _.fromPromise(this.__scoreBatchOfTraces(o,e))}async __scoreBatchOfTraces(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/feedback-scores"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ti.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/traces/feedback-scores")}searchTraceThreads(o={},e){return _.fromPromise(this.__searchTraceThreads(o,e))}async __searchTraceThreads(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/search"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:xo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),responseType:"streaming",timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:i.body,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/threads/search")}searchTraces(o={},e){return _.fromPromise(this.__searchTraces(o,e))}async __searchTraces(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/search"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ho.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),responseType:"streaming",timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:i.body,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 401:throw new re(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/traces/search")}updateThread(o,e,t){return _.fromPromise(this.__updateThread(o,e,t))}async __updateThread(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/threads/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:yo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/traces/threads/{threadModelId}")}updateThreadComment(o,e,t){return _.fromPromise(this.__updateThreadComment(o,e,t))}async __updateThreadComment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/threads/comments/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:O.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/traces/threads/comments/{commentId}")}updateTraceComment(o,e,t){return _.fromPromise(this.__updateTraceComment(o,e,t))}async __updateTraceComment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/comments/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:O.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/traces/comments/{commentId}")}};var mn=class{constructor(o={}){this._options=F(o);}getWelcomeWizardStatus(o){return _.fromPromise(this.__getWelcomeWizardStatus(o))}async __getWelcomeWizardStatus(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/welcome-wizard"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Cu.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/private/welcome-wizard")}submitWelcomeWizard(o={},e){return _.fromPromise(this.__submitWelcomeWizard(o,e))}async __submitWelcomeWizard(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/welcome-wizard"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ro.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/welcome-wizard")}};var dn=class{constructor(o={}){this._options=F(o);}costsSummary(o,e){return _.fromPromise(this.__costsSummary(o,e))}async __costsSummary(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/workspaces/costs/summaries"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Gr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:xr.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/workspaces/costs/summaries")}getWorkspaceConfiguration(o){return _.fromPromise(this.__getWorkspaceConfiguration(o))}async __getWorkspaceConfiguration(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/workspaces/configurations"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:mi.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw t.error.statusCode===404?new I(t.error.body,t.rawResponse):new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/private/workspaces/configurations")}upsertWorkspaceConfiguration(o,e){return _.fromPromise(this.__upsertWorkspaceConfiguration(o,e))}async __upsertWorkspaceConfiguration(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/workspaces/configurations"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:mi.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:mi.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"PUT","/v1/private/workspaces/configurations")}deleteWorkspaceConfiguration(o){return _.fromPromise(this.__deleteWorkspaceConfiguration(o))}async __deleteWorkspaceConfiguration(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/workspaces/configurations"),method:"DELETE",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:void 0,rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw t.error.statusCode===404?new I(t.error.body,t.rawResponse):new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"DELETE","/v1/private/workspaces/configurations")}getCost(o,e){return _.fromPromise(this.__getCost(o,e))}async __getCost(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/workspaces/costs"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Gr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Va.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/workspaces/costs")}getMetric(o,e){return _.fromPromise(this.__getMetric(o,e))}async __getMetric(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/workspaces/metrics"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Gr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Va.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/workspaces/metrics")}metricsSummary(o,e){return _.fromPromise(this.__metricsSummary(o,e))}async __metricsSummary(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/workspaces/metrics/summaries"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Gr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Iu.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/workspaces/metrics/summaries")}};var di=class{constructor(o={}){this._options=F(o);}get systemUsage(){var o;return (o=this._systemUsage)!=null?o:this._systemUsage=new cn(this._options)}get alerts(){var o;return (o=this._alerts)!=null?o:this._alerts=new La(this._options)}get annotationQueues(){var o;return (o=this._annotationQueues)!=null?o:this._annotationQueues=new Ha(this._options)}get attachments(){var o;return (o=this._attachments)!=null?o:this._attachments=new Ja(this._options)}get check(){var o;return (o=this._check)!=null?o:this._check=new $a(this._options)}get automationRuleEvaluators(){var o;return (o=this._automationRuleEvaluators)!=null?o:this._automationRuleEvaluators=new Ga(this._options)}get chatCompletions(){var o;return (o=this._chatCompletions)!=null?o:this._chatCompletions=new Ka(this._options)}get dashboards(){var o;return (o=this._dashboards)!=null?o:this._dashboards=new Qa(this._options)}get datasets(){var o;return (o=this._datasets)!=null?o:this._datasets=new Ya(this._options)}get experiments(){var o;return (o=this._experiments)!=null?o:this._experiments=new Xa(this._options)}get feedbackDefinitions(){var o;return (o=this._feedbackDefinitions)!=null?o:this._feedbackDefinitions=new Za(this._options)}get guardrails(){var o;return (o=this._guardrails)!=null?o:this._guardrails=new Oa(this._options)}get llmProviderKey(){var o;return (o=this._llmProviderKey)!=null?o:this._llmProviderKey=new qa(this._options)}get manualEvaluation(){var o;return (o=this._manualEvaluation)!=null?o:this._manualEvaluation=new en(this._options)}get openTelemetryIngestion(){var o;return (o=this._openTelemetryIngestion)!=null?o:this._openTelemetryIngestion=new rn(this._options)}get optimizations(){var o;return (o=this._optimizations)!=null?o:this._optimizations=new tn(this._options)}get projects(){var o;return (o=this._projects)!=null?o:this._projects=new on(this._options)}get prompts(){var o;return (o=this._prompts)!=null?o:this._prompts=new an(this._options)}get serviceToggles(){var o;return (o=this._serviceToggles)!=null?o:this._serviceToggles=new sn(this._options)}get spans(){var o;return (o=this._spans)!=null?o:this._spans=new pn(this._options)}get traces(){var o;return (o=this._traces)!=null?o:this._traces=new ln(this._options)}get welcomeWizard(){var o;return (o=this._welcomeWizard)!=null?o:this._welcomeWizard=new mn(this._options)}get workspaces(){var o;return (o=this._workspaces)!=null?o:this._workspaces=new dn(this._options)}get redirect(){var o;return (o=this._redirect)!=null?o:this._redirect=new nn(this._options)}isAlive(o){return _.fromPromise(this.__isAlive(o))}async __isAlive(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"is-alive/ping"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:t.body,rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/is-alive/ping")}version(o){return _.fromPromise(this.__version(o))}async __version(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"is-alive/ver"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:t.body,rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/is-alive/ver")}};var Ih;(e=>(e.LogLevel=fe,e.ConsoleLogger=er))(Ih||(Ih={}));var ae=()=>uuid.v7();var Kr=class{static serializePromptToInfoDict(o){return {name:o.name,...o.id&&{id:o.id},version:{...o.versionId&&{id:o.versionId},...o.commit&&{commit:o.commit},template:o.prompt}}}static normalizeMetadata(o){if(!o)return {};if(typeof o=="object"&&!Array.isArray(o))return o;if(typeof o=="string")try{let e=JSON.parse(o);if(typeof e=="object"&&!Array.isArray(e))return e}catch{}return {}}static mergePromptsIntoMetadata(o,e,t){let i=t.map(p=>this.serializePromptToInfoDict(p)),a=this.normalizeMetadata(o),s=this.normalizeMetadata(e);return {...a,...s,opik_prompts:i}}static processTraceUpdate(o,e){let{prompts:t,...i}=o;if(!t||t.length===0)return i;let a=this.mergePromptsIntoMetadata(e,i.metadata,t);return {...i,metadata:a}}static processSpanUpdate(o,e){let{prompts:t,...i}=o;if(!t||t.length===0)return i;let a=this.mergePromptsIntoMetadata(e,i.metadata,t);return {...i,metadata:a}}};var un=class n{constructor(o,e){this.data=o;this.opik=e;this.childSpans=[];this.end=()=>this.update({endTime:new Date});this.score=o=>{var e;this.opik.spanFeedbackScoresBatchQueue.create({...o,projectName:(e=this.data.projectName)!=null?e:this.opik.config.projectName,id:this.data.id,source:"sdk"});};this.update=o=>{var i;let e=Kr.processSpanUpdate(o,this.data.metadata),t={parentSpanId:this.data.parentSpanId,projectName:(i=this.data.projectName)!=null?i:this.opik.config.projectName,traceId:this.data.traceId,...e};return this.opik.spanBatchQueue.update(this.data.id,t),this.data={...this.data,...o},this};this.span=o=>{var a;let e=(a=this.data.projectName)!=null?a:this.opik.config.projectName,t={id:ae(),startTime:new Date,...o,projectName:e,traceId:this.data.traceId,parentSpanId:this.data.id};this.opik.spanBatchQueue.create(t);let i=new n(t,this.opik);return this.childSpans.push(i),i};}};var fn=class{constructor(o,e){this.data=o;this.opik=e;this.spans=[];this.end=()=>this.update({endTime:new Date});this.score=o=>{var e;this.opik.traceFeedbackScoresBatchQueue.create({...o,projectName:(e=this.data.projectName)!=null?e:this.opik.config.projectName,id:this.data.id,source:"sdk"});};this.span=o=>{var a,s;let e=(s=(a=this.data.projectName)!=null?a:o.projectName)!=null?s:this.opik.config.projectName,t={id:ae(),startTime:new Date,...o,projectName:e,traceId:this.data.id};this.opik.spanBatchQueue.create(t);let i=new un(t,this.opik);return this.spans.push(i),i};this.update=o=>{var i;let e=Kr.processTraceUpdate(o,this.data.metadata),t={projectName:(i=this.data.projectName)!=null?i:this.opik.config.projectName,...e};return this.opik.traceBatchQueue.update(this.data.id,t),this.data={...this.data,...t},this};}};var Dh={EXPERIMENTS:"api/v1/session/redirect/experiments/",PROJECT_BY_NAME:"redirect/projects"},hn={EXPERIMENT_ID:"experiment_id",DATASET_ID:"dataset_id",PROJECT_NAME:"name",PATH:"path"},oR=n=>Object.entries(n).map(([o,e])=>`${o}=${encodeURIComponent(e)}`).join("&").replace(/%3A/g,":").replace(/%2F/g,"/").replace(/%26/g,"&").replace(/%3F/g,"?").replace(/%3D/g,"="),iR=n=>n.replace(/\/api$/,""),aR=n=>Buffer.from(n).toString("base64"),Uh=(n,o,e)=>{let t=oR(e),i=`${o}?${t}`;return new URL(i,n).toString()},Fh=({datasetId:n,experimentId:o,baseUrl:e})=>Uh(e,Dh.EXPERIMENTS,{[hn.EXPERIMENT_ID]:o,[hn.DATASET_ID]:n,[hn.PATH]:aR(e)});var Nh=({projectName:n,workspaceName:o,apiUrl:e})=>{let t=iR(e),i=`${o}/${Dh.PROJECT_BY_NAME}`;return Uh(t,i,{[hn.PROJECT_NAME]:n})};var nR=300,gn=100,ui=class{constructor({action:o,batchSize:e=gn,delay:t,enableBatch:i,name:a="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=(o,e)=>{if(this.queue.set(o,e),!this.enableBatch){this.flush();return}if(this.queue.size>=this.batchSize){this.flush();return}this.debounceFlush();};this.update=(o,e)=>{let t=this.queue.get(o);t&&(this.queue.set(o,{...t,...e}),this.debounceFlush());};this.flush=async()=>{if(this.queue.size===0)return this.promise;let o=new Map(this.queue);this.queue.clear(),j.debug(`Adding ${o.size} items to ${this.name} promise:`,o),this.promise=this.promise.finally(()=>(j.debug(`Flushing ${this.name}:`,o),this.action(o))).catch(e=>{j.error(`Failed to flush ${this.name}:`,e,o);}),await this.promise;};this.action=o,this.batchSize=e,this.delay=t,this.enableBatch=i,this.name=a;}},xe=class{constructor({delay:o=nR,enableCreateBatch:e=true,enableUpdateBatch:t=false,enableDeleteBatch:i=true,createBatchSize:a=gn,updateBatchSize:s=gn,deleteBatchSize:p=gn,name:l="BatchQueue"}={}){this.create=o=>{let e=this.getId(o);this.createQueue.add(e,o);};this.get=async o=>{let e=this.createQueue.queue.get(o);return e||this.getEntity(o)};this.update=(o,e)=>{if(this.createQueue.queue.get(o)){this.createQueue.update(o,e);return}this.updateQueue.add(o,e);};this.delete=o=>{if(this.createQueue.queue.has(o)){this.createQueue.queue.delete(o);return}this.deleteQueue.add(o);};this.flush=async()=>{await this.createQueue.flush(),await this.updateQueue.flush(),await this.deleteQueue.flush();};this.name=l,this.createQueue=new ui({action:async c=>{await this.createEntities(Array.from(c.values()));},delay:o,enableBatch:e,batchSize:a,name:`${l}:createQueue`}),this.updateQueue=new ui({action:async c=>{await this.createQueue.flush();let d=Array.from(c.entries());for(let[m,f]of d)await this.updateEntity(m,f);},delay:o,enableBatch:t,batchSize:s,name:`${l}:updateQueue`}),this.deleteQueue=new ui({action:async c=>{await this.createQueue.flush(),await this.updateQueue.flush(),await this.deleteEntities(Array.from(c.keys()));},delay:o,enableBatch:i,batchSize:p,name:`${l}:deleteQueue`});}};var yn=class extends xe{constructor(e,t){super({delay:t,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,t){await this.api.spans.updateSpan(e,{body:t},this.api.requestOptions);}async deleteEntities(e){for(let t of e)await this.api.spans.deleteSpanById(t,this.api.requestOptions);}};var bn=class extends xe{constructor(e,t){super({delay:t,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 t of e)await this.api.spans.deleteSpanFeedbackScore(t.id,{body:{name:t.name}},this.api.requestOptions);}};var xn=class extends xe{constructor(e,t){super({delay:t,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,t){await this.api.traces.updateTrace(e,{body:t},this.api.requestOptions);}async deleteEntities(e){await this.api.traces.deleteTraces({ids:e},this.api.requestOptions);}};var Rn=class extends xe{constructor(e,t){super({delay:t,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 t of e)await this.api.traces.deleteTraceFeedbackScore(t.id,{body:{name:t.name}},this.api.requestOptions);}};var wn=class extends di{constructor(e){super(e);this.setHeaders=e=>{this.requestOptions.headers=e;};this.requestOptions=(e==null?void 0:e.requestOptions)||{};}};var _n=class extends xe{constructor(e,t){super({delay:t,enableCreateBatch:true,enableUpdateBatch:true,enableDeleteBatch:true,name:"DatasetBatchQueue"});this.api=e;}getId(e){return e.id||""}async createEntities(e){for(let t of e)await this.api.datasets.createDataset(t,this.api.requestOptions);}async getEntity(e){try{return await this.api.datasets.getDatasetById(e,this.api.requestOptions)}catch{return}}async updateEntity(e,t){await this.api.datasets.updateDataset(e,{name:t.name||"",visibility:t.visibility,description:t.description},this.api.requestOptions);}async deleteEntities(e){await this.api.datasets.deleteDatasetsBatch({ids:e},this.api.requestOptions);}};var Uu=null;async function Mh(){return Uu||(Uu=await sR__default.default()),Uu}var fi=class n{constructor(o){let{id:e,traceId:t,spanId:i,source:a,...s}=o;this.id=e||ae(),this.traceId=t,this.spanId=i,this.source=a||cs.Sdk,this.data={...s};}getContent(o=false){return o?{...this.data,id:this.id}:{...this.data}}async contentHash(){let o=this.getContent(),e=pR__default.default(o);return (await Mh()).h32(e,43981).toString(16)}toApiModel(){return {id:this.id,traceId:this.traceId,spanId:this.spanId,source:this.source,data:this.getContent()}}static fromApiModel(o){return new n({id:o.id,traceId:o.traceId,spanId:o.spanId,source:o.source,...o.data})}};async function Ge(n,o,e){var p;if(e===0)return [];let t=new util.TextDecoder("utf-8"),i=[],a="",s=n.getReader();try{for(;;){let{done:l,value:c}=await s.read();if(l)break;let d=c;a+=t.decode(d,{stream:!0});let m=a.split(`
|
|
4
|
-
`);a=(p=m.pop())!=null?p:"";for(let f of m)if(!(!f.trim()||f==="{}"||f==="[]"||f==="null"))try{let u=JSON.parse(f),h=o.parse(u);if(h.ok){if(i.push(h.value),e!==void 0&&i.length>=e)return s.releaseLock(),i}else j.error("Error parsing experiment item:",h.errors);}catch(u){j.error("Error parsing JSON line:",u instanceof Error?u.message:String(u));}}if(a.trim()&&a!=="{}"&&a!=="[]"&&a!=="null")try{let l=JSON.parse(a),c=o.parse(l);c.ok?i.push(c.value):j.error("Error parsing experiment item:",c.errors);}catch(l){j.error("Error parsing remaining buffer:",l instanceof Error?l.message:String(l));}}catch(l){j.error("Error processing stream:",l instanceof Error?l.message:String(l));}finally{s.releaseLock();}return i}function
|
|
1
|
+
'use strict';var ansiEscapes=require('ansi-escapes'),tslog=require('tslog'),cf=require('fs'),Lg=require('ini');require('dotenv/config');var uuid=require('uuid'),cR=require('fast-json-stable-stringify'),pR=require('xxhash-wasm'),util=require('util'),fR=require('mustache'),yR=require('nunjucks'),dateFns=require('date-fns'),jestDiff=require('jest-diff'),RR=require('fast-deep-equal'),async_hooks=require('async_hooks'),Mn=require('chalk'),ER=require('boxen'),CR=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 cf__default=/*#__PURE__*/_interopDefault(cf);var Lg__default=/*#__PURE__*/_interopDefault(Lg);var cR__default=/*#__PURE__*/_interopDefault(cR);var pR__default=/*#__PURE__*/_interopDefault(pR);var fR__default=/*#__PURE__*/_interopDefault(fR);var yR__default=/*#__PURE__*/_interopDefault(yR);var RR__default=/*#__PURE__*/_interopDefault(RR);var Mn__default=/*#__PURE__*/_interopDefault(Mn);var ER__default=/*#__PURE__*/_interopDefault(ER);var CR__default=/*#__PURE__*/_interopDefault(CR);var Cg=Object.create;var vi=Object.defineProperty;var Ig=Object.getOwnPropertyDescriptor;var tf=(n,o)=>(o=Symbol[n])?o:Symbol.for("Symbol."+n),ot=n=>{throw TypeError(n)};var Dg=(n,o,e)=>o in n?vi(n,o,{enumerable:true,configurable:true,writable:true,value:e}):n[o]=e;var W=(n,o)=>{for(var e in o)vi(n,e,{get:o[e],enumerable:true});};var of=n=>{var o;return [,,,Cg((o=void 0)!=null?o:null)]},af=["class","method","getter","setter","accessor","field","value","get","set"],tt=n=>n!==void 0&&typeof n!="function"?ot("Function expected"):n,Ug=(n,o,e,t,i)=>({kind:af[n],name:o,metadata:t,addInitializer:a=>e._?ot("Already initialized"):i.push(tt(a||null))}),Qn=(n,o)=>Dg(o,tf("metadata"),n[3]),nf=(n,o,e,t)=>{for(var i=0,a=n[o>>1],s=a&&a.length;i<s;i++)a[i].call(e);return t},sf=(n,o,e,t,i,a)=>{var p,l,c,d,m=o&7,f=false,u=false,h=2,g=af[m+5],T=n[h]||(n[h]=[]),v=((i=i.prototype),Ig(i,e));for(var E=t.length-1;E>=0;E--)c=Ug(m,e,l={},n[3],T),(c.static=f,c.private=u,d=c.access={has:C=>e in C},(d.get=C=>C[e]),m>2),p=(0, t[E])(v[g],c),l._=1,tt(p)&&(v[g]=p);return v&&vi(i,e,v),i};var Bg={SILLY:0,TRACE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,FATAL:6};function ji(n,o=n){return ansiEscapes.link(o,n)}var j=new tslog.Logger({hideLogPositionForProduction:true,prettyLogTemplate:"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}} {{logLevelName}} "}),pf=n=>{j.settings.minLevel=Bg[n];},Vg=()=>{j.settings.minLevel=100;};pf(process.env.OPIK_LOG_LEVEL||"INFO");var Hg="~/.opik.config",Xn={apiKey:"",apiUrl:"https://www.comet.com/opik/api",projectName:"Default Project",workspaceName:"default",batchDelayMs:300,holdUntilFlush:false};function lf(n){return Object.fromEntries(Object.entries(n).filter(([,o])=>o!==void 0))}function Jg(){return lf({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 Gg(){let n=process.env.OPIK_CONFIG_PATH||Hg;if(!cf__default.default.existsSync(n)){if(process.env.OPIK_CONFIG_PATH)throw new Error(`Config file not found at ${n}`);return {}}try{let o=Lg__default.default.parse(cf__default.default.readFileSync(n,"utf8"));return o.opik?lf({apiKey:o.opik.api_key,apiUrl:o.opik.url_override,projectName:o.opik.project_name,workspaceName:o.opik.workspace}):{}}catch(o){return j.error(`Error loading config file ${n}: ${o}`),{}}}function mf(n){let o=Jg(),e=Gg(),{headers:t,...i}=n||{};return Kg({...Xn,...e,...o,...i})}function Kg(n){if(!n.apiUrl)throw new Error("OPIK_URL_OVERRIDE is not set");let o=$g(n.apiUrl);if(o&&!n.apiKey)throw new Error("OPIK_API_KEY is not set");if(o&&!n.workspaceName)throw new Error("OPIK_WORKSPACE is not set");return n}function $g(n){return new URL(n).hostname.endsWith("comet.com")}var ee={};W(ee,{AlertAlertType:()=>Yg,AlertPublicAlertType:()=>Xg,AlertTriggerConfigPublicType:()=>Zg,AlertTriggerConfigType:()=>Og,AlertTriggerConfigWriteType:()=>qg,AlertTriggerEventType:()=>ey,AlertTriggerPublicEventType:()=>ry,AlertTriggerWriteEventType:()=>ty,AlertWriteAlertType:()=>oy,AnnotationQueuePublicScope:()=>iy,AnnotationQueueScope:()=>ay,AnnotationQueueWriteScope:()=>ny,AssistantMessageRole:()=>sy,AttachmentListRequestEntityType:()=>uf,AutomationRuleEvaluatorAction:()=>py,AutomationRuleEvaluatorObjectObjectPublicAction:()=>cy,AutomationRuleEvaluatorPublicAction:()=>ly,AutomationRuleEvaluatorUpdateAction:()=>my,AutomationRuleEvaluatorWriteAction:()=>dy,BadRequestError:()=>D,CheckName:()=>uy,CheckPublicName:()=>fy,CheckPublicResult:()=>hy,CheckResult:()=>gy,ColumnCompareTypesItem:()=>yy,ColumnPublicTypesItem:()=>by,ColumnTypesItem:()=>xy,CompleteMultipartUploadRequestEntityType:()=>Ry,ConflictError:()=>$,CreatePromptVersionDetailTemplateStructure:()=>Tf,DatasetExportJobPublicStatus:()=>wy,DatasetItemCompareSource:()=>_y,DatasetItemFilterOperator:()=>zy,DatasetItemPublicSource:()=>ky,DatasetItemSource:()=>Sy,DatasetItemWriteSource:()=>ms,DatasetPublicStatus:()=>Py,DatasetPublicVisibility:()=>Ay,DatasetStatus:()=>Ty,DatasetUpdateVisibility:()=>yf,DatasetVisibility:()=>vy,DatasetWriteVisibility:()=>bf,DeleteAttachmentsRequestEntityType:()=>jy,DownloadAttachmentRequestEntityType:()=>ff,ExperimentItemCompareTraceVisibilityMode:()=>Ey,ExperimentItemPublicTraceVisibilityMode:()=>Cy,ExperimentItemTraceVisibilityMode:()=>Iy,ExperimentPublicStatus:()=>Dy,ExperimentPublicType:()=>Uy,ExperimentStatus:()=>Fy,ExperimentType:()=>ds,ExperimentUpdateStatus:()=>Ny,ExperimentUpdateType:()=>My,ExperimentWriteStatus:()=>xf,ExperimentWriteType:()=>Rf,FeedbackScoreBatchItemSource:()=>Wy,FeedbackScoreBatchItemThreadSource:()=>By,FeedbackScoreCompareSource:()=>Vy,FeedbackScoreExperimentItemBulkWriteViewSource:()=>Ly,FeedbackScorePublicSource:()=>Hy,FeedbackScoreSource:()=>Jy,FindFeedbackDefinitionsRequestType:()=>wf,FindFeedbackScoreNames1RequestType:()=>Ef,ForbiddenError:()=>ne,GetSpanStatsRequestType:()=>Cf,GetSpansByProjectRequestType:()=>If,GetWebhookExamplesRequestAlertType:()=>df,GuardrailName:()=>Gy,GuardrailResult:()=>Ky,GuardrailWriteName:()=>$y,GuardrailWriteResult:()=>Qy,LlmAsJudgeMessagePublicRole:()=>Yy,LlmAsJudgeMessageRole:()=>Xy,LlmAsJudgeMessageWriteRole:()=>Zy,LlmAsJudgeOutputSchemaPublicType:()=>Oy,LlmAsJudgeOutputSchemaType:()=>qy,LlmAsJudgeOutputSchemaWriteType:()=>eb,LogItemLevel:()=>rb,ManualEvaluationRequestEntityType:()=>tb,NotFoundError:()=>I,NotImplementedError:()=>qe,OptimizationPublicStatus:()=>ob,OptimizationStatus:()=>ib,OptimizationUpdateStatus:()=>zf,OptimizationWriteStatus:()=>ab,ProjectDetailedVisibility:()=>nb,ProjectMetricRequestPublicInterval:()=>kf,ProjectMetricRequestPublicMetricType:()=>Sf,ProjectMetricResponsePublicInterval:()=>sb,ProjectMetricResponsePublicMetricType:()=>pb,ProjectPublicVisibility:()=>cb,ProjectUpdateVisibility:()=>Pf,ProjectVisibility:()=>lb,ProjectWriteVisibility:()=>Af,PromptDetailTemplateStructure:()=>mb,PromptPublicTemplateStructure:()=>db,PromptTemplateStructure:()=>ub,PromptType:()=>fb,PromptVersionDetailTemplateStructure:()=>hb,PromptVersionDetailType:()=>gb,PromptVersionPublicTemplateStructure:()=>yb,PromptVersionPublicType:()=>bb,PromptVersionTemplateStructure:()=>xb,PromptVersionType:()=>Rb,PromptWriteTemplateStructure:()=>vf,PromptWriteType:()=>jf,ProviderApiKeyProvider:()=>wb,ProviderApiKeyPublicProvider:()=>_b,ProviderApiKeyWriteProvider:()=>_f,ResponseFormatType:()=>zb,SpanExperimentItemBulkWriteViewType:()=>kb,SpanFilterOperator:()=>Sb,SpanFilterPublicOperator:()=>Pb,SpanFilterWriteOperator:()=>Ab,SpanPublicType:()=>Tb,SpanSearchStreamRequestPublicType:()=>Df,SpanType:()=>Ce,SpanUpdateType:()=>vb,SpanWriteType:()=>jb,StartMultipartUploadRequestEntityType:()=>hf,ToolCallType:()=>Eb,ToolType:()=>Cb,TraceFilterOperator:()=>Ib,TraceFilterPublicOperator:()=>Db,TraceFilterWriteOperator:()=>Ub,TracePublicVisibilityMode:()=>Fb,TraceThreadFilterOperator:()=>Nb,TraceThreadFilterPublicOperator:()=>Mb,TraceThreadFilterWriteOperator:()=>Wb,TraceThreadStatus:()=>Bb,TraceVisibilityMode:()=>Vb,UnauthorizedError:()=>re,UnprocessableEntityError:()=>Z,UploadAttachmentRequestEntityType:()=>gf,ValueEntryCompareSource:()=>Lb,ValueEntryExperimentItemBulkWriteViewSource:()=>Hb,ValueEntryPublicSource:()=>Jb,ValueEntrySource:()=>Gb,WebhookTestResultStatus:()=>Kb,alerts:()=>Ei,annotationQueues:()=>Zn,attachments:()=>Ci,automationRuleEvaluators:()=>On,chatCompletions:()=>qn,check:()=>es,dashboards:()=>rs,datasets:()=>Ii,experiments:()=>Di,feedbackDefinitions:()=>Ui,guardrails:()=>ts,llmProviderKey:()=>Fi,manualEvaluation:()=>os,openTelemetryIngestion:()=>is,optimizations:()=>Ni,projects:()=>Mi,prompts:()=>Wi,redirect:()=>as,serviceToggles:()=>ns,spans:()=>Bi,systemUsage:()=>ss,traces:()=>ps,welcomeWizard:()=>cs,workspaces:()=>ls});var Se=(n,o,e)=>JSON.stringify(n,o,e);function it(n,o){return JSON.parse(n,o)}var w=class extends Error{constructor({message:o,statusCode:e,body:t,rawResponse:i}){super(Qg({message:o,statusCode:e,body:t})),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.statusCode=e,this.body=t,this.rawResponse=i;}};function Qg({message:n,statusCode:o,body:e}){let t=[];return n!=null&&t.push(n),o!=null&&t.push(`Status code: ${o.toString()}`),e!=null&&t.push(`Body: ${Se(e,void 0,2)}`),t.join(`
|
|
2
|
+
`)}var Sr=class extends Error{constructor(o){super(o),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var D=class extends w{constructor(o,e){super({message:"BadRequestError",statusCode:400,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var $=class extends w{constructor(o,e){super({message:"ConflictError",statusCode:409,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var ne=class extends w{constructor(o,e){super({message:"ForbiddenError",statusCode:403,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var I=class extends w{constructor(o,e){super({message:"NotFoundError",statusCode:404,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var qe=class extends w{constructor(o,e){super({message:"NotImplementedError",statusCode:501,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var re=class extends w{constructor(o,e){super({message:"UnauthorizedError",statusCode:401,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var Z=class extends w{constructor(o,e){super({message:"UnprocessableEntityError",statusCode:422,body:o,rawResponse:e}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var Ei={};W(Ei,{GetWebhookExamplesRequestAlertType:()=>df});var df={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var Zn={};var Ci={};W(Ci,{AttachmentListRequestEntityType:()=>uf,DownloadAttachmentRequestEntityType:()=>ff,StartMultipartUploadRequestEntityType:()=>hf,UploadAttachmentRequestEntityType:()=>gf});var uf={Trace:"trace",Span:"span"};var ff={Trace:"trace",Span:"span"};var hf={Trace:"trace",Span:"span"};var gf={Trace:"trace",Span:"span"};var On={};var qn={};var es={};var rs={};var Ii={};W(Ii,{DatasetUpdateVisibility:()=>yf,DatasetWriteVisibility:()=>bf});var yf={Private:"private",Public:"public"};var bf={Private:"private",Public:"public"};var Di={};W(Di,{ExperimentWriteStatus:()=>xf,ExperimentWriteType:()=>Rf});var xf={Running:"running",Completed:"completed",Cancelled:"cancelled"};var Rf={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var Ui={};W(Ui,{FindFeedbackDefinitionsRequestType:()=>wf});var wf={Numerical:"numerical",Categorical:"categorical",Boolean:"boolean"};var ts={};var Fi={};W(Fi,{ProviderApiKeyWriteProvider:()=>_f});var _f={Openai:"openai",Anthropic:"anthropic",Gemini:"gemini",Openrouter:"openrouter",VertexAi:"vertex-ai",Bedrock:"bedrock",CustomLlm:"custom-llm",OpikFree:"opik-free"};var os={};var is={};var Ni={};W(Ni,{OptimizationUpdateStatus:()=>zf});var zf={Running:"running",Completed:"completed",Cancelled:"cancelled",Initialized:"initialized",Error:"error"};var Mi={};W(Mi,{ProjectMetricRequestPublicInterval:()=>kf,ProjectMetricRequestPublicMetricType:()=>Sf,ProjectUpdateVisibility:()=>Pf,ProjectWriteVisibility:()=>Af});var kf={Hourly:"HOURLY",Daily:"DAILY",Weekly:"WEEKLY"};var Sf={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",SpanFeedbackScores:"SPAN_FEEDBACK_SCORES",SpanCount:"SPAN_COUNT",SpanDuration:"SPAN_DURATION",SpanTokenUsage:"SPAN_TOKEN_USAGE"};var Pf={Private:"private",Public:"public"};var Af={Private:"private",Public:"public"};var Wi={};W(Wi,{CreatePromptVersionDetailTemplateStructure:()=>Tf,PromptWriteTemplateStructure:()=>vf,PromptWriteType:()=>jf});var Tf={Text:"text",Chat:"chat"};var vf={Text:"text",Chat:"chat"};var jf={Mustache:"mustache",Jinja2:"jinja2"};var as={};var ns={};var Bi={};W(Bi,{FindFeedbackScoreNames1RequestType:()=>Ef,GetSpanStatsRequestType:()=>Cf,GetSpansByProjectRequestType:()=>If,SpanSearchStreamRequestPublicType:()=>Df});var Ef={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Cf={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var If={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Df={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var ss={};var ps={};var cs={};var ls={};var Yg={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var Xg={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var Zg={ScopeProject:"scope:project",ThresholdFeedbackScore:"threshold:feedback_score",ThresholdCost:"threshold:cost",ThresholdLatency:"threshold:latency",ThresholdErrors:"threshold:errors"};var Og={ScopeProject:"scope:project",ThresholdFeedbackScore:"threshold:feedback_score",ThresholdCost:"threshold:cost",ThresholdLatency:"threshold:latency",ThresholdErrors:"threshold:errors"};var qg={ScopeProject:"scope:project",ThresholdFeedbackScore:"threshold:feedback_score",ThresholdCost:"threshold:cost",ThresholdLatency:"threshold:latency",ThresholdErrors:"threshold:errors"};var ey={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 ry={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 ty={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 oy={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var iy={Trace:"trace",Thread:"thread"};var ay={Trace:"trace",Thread:"thread"};var ny={Trace:"trace",Thread:"thread"};var sy={System:"system",User:"user",Assistant:"assistant",Tool:"tool",Function:"function"};var py={Evaluator:"evaluator"};var cy={Evaluator:"evaluator"};var ly={Evaluator:"evaluator"};var my={Evaluator:"evaluator"};var dy={Evaluator:"evaluator"};var uy={Topic:"TOPIC",Pii:"PII"};var fy={Topic:"TOPIC",Pii:"PII"};var hy={Passed:"passed",Failed:"failed"};var gy={Passed:"passed",Failed:"failed"};var yy={String:"string",Number:"number",Object:"object",Boolean:"boolean",Array:"array",Null:"null"};var by={String:"string",Number:"number",Object:"object",Boolean:"boolean",Array:"array",Null:"null"};var xy={String:"string",Number:"number",Object:"object",Boolean:"boolean",Array:"array",Null:"null"};var Ry={Trace:"trace",Span:"span"};var wy={Pending:"PENDING",Processing:"PROCESSING",Completed:"COMPLETED",Failed:"FAILED"};var _y={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var zy={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 ky={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var Sy={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var ms={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var Py={Unknown:"unknown",Processing:"processing",Completed:"completed",Failed:"failed"};var Ay={Private:"private",Public:"public"};var Ty={Unknown:"unknown",Processing:"processing",Completed:"completed",Failed:"failed"};var vy={Private:"private",Public:"public"};var jy={Trace:"trace",Span:"span"};var Ey={Default:"default",Hidden:"hidden"};var Cy={Default:"default",Hidden:"hidden"};var Iy={Default:"default",Hidden:"hidden"};var Dy={Running:"running",Completed:"completed",Cancelled:"cancelled"};var Uy={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var Fy={Running:"running",Completed:"completed",Cancelled:"cancelled"};var ds={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var Ny={Running:"running",Completed:"completed",Cancelled:"cancelled"};var My={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var Wy={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var By={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Vy={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Ly={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Hy={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Jy={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Gy={Topic:"TOPIC",Pii:"PII"};var Ky={Passed:"passed",Failed:"failed"};var $y={Topic:"TOPIC",Pii:"PII"};var Qy={Passed:"passed",Failed:"failed"};var Yy={System:"SYSTEM",User:"USER",Ai:"AI",ToolExecutionResult:"TOOL_EXECUTION_RESULT",Custom:"CUSTOM"};var Xy={System:"SYSTEM",User:"USER",Ai:"AI",ToolExecutionResult:"TOOL_EXECUTION_RESULT",Custom:"CUSTOM"};var Zy={System:"SYSTEM",User:"USER",Ai:"AI",ToolExecutionResult:"TOOL_EXECUTION_RESULT",Custom:"CUSTOM"};var Oy={Boolean:"BOOLEAN",Integer:"INTEGER",Double:"DOUBLE"};var qy={Boolean:"BOOLEAN",Integer:"INTEGER",Double:"DOUBLE"};var eb={Boolean:"BOOLEAN",Integer:"INTEGER",Double:"DOUBLE"};var rb={Info:"INFO",Warn:"WARN",Error:"ERROR",Debug:"DEBUG",Trace:"TRACE"};var tb={Trace:"trace",Thread:"thread",Span:"span"};var ob={Running:"running",Completed:"completed",Cancelled:"cancelled",Initialized:"initialized",Error:"error"};var ib={Running:"running",Completed:"completed",Cancelled:"cancelled",Initialized:"initialized",Error:"error"};var ab={Running:"running",Completed:"completed",Cancelled:"cancelled",Initialized:"initialized",Error:"error"};var nb={Private:"private",Public:"public"};var sb={Hourly:"HOURLY",Daily:"DAILY",Weekly:"WEEKLY"};var pb={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",SpanFeedbackScores:"SPAN_FEEDBACK_SCORES",SpanCount:"SPAN_COUNT",SpanDuration:"SPAN_DURATION",SpanTokenUsage:"SPAN_TOKEN_USAGE"};var cb={Private:"private",Public:"public"};var lb={Private:"private",Public:"public"};var mb={Text:"text",Chat:"chat"};var db={Text:"text",Chat:"chat"};var ub={Text:"text",Chat:"chat"};var fb={Mustache:"mustache",Jinja2:"jinja2"};var hb={Text:"text",Chat:"chat"};var gb={Mustache:"mustache",Jinja2:"jinja2"};var yb={Text:"text",Chat:"chat"};var bb={Mustache:"mustache",Jinja2:"jinja2"};var xb={Text:"text",Chat:"chat"};var Rb={Mustache:"mustache",Jinja2:"jinja2"};var wb={Openai:"openai",Anthropic:"anthropic",Gemini:"gemini",Openrouter:"openrouter",VertexAi:"vertex-ai",Bedrock:"bedrock",CustomLlm:"custom-llm",OpikFree:"opik-free"};var _b={Openai:"openai",Anthropic:"anthropic",Gemini:"gemini",Openrouter:"openrouter",VertexAi:"vertex-ai",Bedrock:"bedrock",CustomLlm:"custom-llm",OpikFree:"opik-free"};var zb={Text:"text",JsonObject:"json_object",JsonSchema:"json_schema"};var kb={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Sb={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 Pb={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 Ab={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 Tb={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Ce={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var vb={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var jb={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Eb={Function:"function"};var Cb={Function:"function"};var Ib={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 Db={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 Ub={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 Fb={Default:"default",Hidden:"hidden"};var Nb={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 Mb={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 Wb={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 Bb={Active:"active",Inactive:"inactive"};var Vb={Default:"default",Hidden:"hidden"};var Lb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Hb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Jb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Gb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var Kb={Success:"success",Failure:"failure"};function z(...n){let o={};for(let[e,t]of n.filter(i=>i!=null).flatMap(i=>Object.entries(i))){let i=e.toLowerCase();t!=null?o[i]=t:i in o&&delete o[i];}return o}function P(...n){let o={};for(let[e,t]of n.filter(i=>i!=null).flatMap(i=>Object.entries(i))){let i=e.toLowerCase();t!=null&&(o[i]=t);}return o}var us={get:async(n,o)=>typeof n=="function"?n(o):n};var fe={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},Uf={[fe.Debug]:1,[fe.Info]:2,[fe.Warn]:3,[fe.Error]:4},er=class{debug(o,...e){console.debug(o,...e);}info(o,...e){console.info(o,...e);}warn(o,...e){console.warn(o,...e);}error(o,...e){console.error(o,...e);}},Pr=class{constructor(o){this.level=Uf[o.level],this.logger=o.logger,this.silent=o.silent;}shouldLog(o){return !this.silent&&this.level<=Uf[o]}isDebug(){return this.shouldLog(fe.Debug)}debug(o,...e){this.isDebug()&&this.logger.debug(o,...e);}isInfo(){return this.shouldLog(fe.Info)}info(o,...e){this.isInfo()&&this.logger.info(o,...e);}isWarn(){return this.shouldLog(fe.Warn)}warn(o,...e){this.isWarn()&&this.logger.warn(o,...e);}isError(){return this.shouldLog(fe.Error)}error(o,...e){this.isError()&&this.logger.error(o,...e);}};function fs(n){return n==null?$b:n instanceof Pr?n:(n=n!=null?n:{},(n.level)!=null||(n.level=fe.Info),(n.logger)!=null||(n.logger=new er),(n.silent)!=null||(n.silent=true),new Pr(n))}var $b=new Pr({level:fe.Info,logger:new er,silent:true});var Yb={arrayFormat:"indices",encode:true};function Ff(n,o){if(n===void 0||n===null)return "";let e=String(n);return o?encodeURIComponent(e):e}function hs(n,o="",e){let t=[];for(let[i,a]of Object.entries(n)){let s=o?`${o}[${i}]`:i;if(a!==void 0)if(Array.isArray(a)){if(a.length===0)continue;for(let p=0;p<a.length;p++){let l=a[p];if(l!==void 0)if(typeof l=="object"&&!Array.isArray(l)&&l!==null){let c=e.arrayFormat==="indices"?`${s}[${p}]`:s;t.push(...hs(l,c,e));}else {let c=e.arrayFormat==="indices"?`${s}[${p}]`:s,d=e.encode?encodeURIComponent(c):c;t.push(`${d}=${Ff(l,e.encode)}`);}}}else if(typeof a=="object"&&a!==null){if(Object.keys(a).length===0)continue;t.push(...hs(a,s,e));}else {let p=e.encode?encodeURIComponent(s):s;t.push(`${p}=${Ff(a,e.encode)}`);}}return t}function rr(n,o){return n==null||typeof n!="object"?"":hs(n,"",{...Yb,...o}).join("&")}function Nf(n,o){let e=rr(o,{arrayFormat:"repeat"});return e?`${n}?${e}`:n}function Mf(n){let o={get bodyUsed(){return n.bodyUsed},stream:()=>n.body,arrayBuffer:n.arrayBuffer.bind(n),blob:n.blob.bind(n)};return "bytes"in n&&typeof n.bytes=="function"&&(o.bytes=n.bytes.bind(n)),o}async function Vi(n,o){switch(o){case "binary-response":return Mf(n);case "blob":return await n.blob();case "arrayBuffer":return await n.arrayBuffer();case "sse":return n.body==null?{ok:false,error:{reason:"body-is-null",statusCode:n.status}}:n.body;case "streaming":return n.body==null?{ok:false,error:{reason:"body-is-null",statusCode:n.status}}:n.body;case "text":return await n.text()}let e=await n.text();if(e.length>0)try{return it(e)}catch{return {ok:false,error:{reason:"non-json",statusCode:n.status,rawBody:e}}}}async function Wf(n){var e,t,i;let o=(e=n.headers.get("Content-Type"))==null?void 0:e.toLowerCase();if(o==null||o.length===0)return Vi(n);switch(o.indexOf(";")!==-1&&(o=(i=(t=o.split(";")[0])==null?void 0:t.trim())!=null?i:""),o){case "application/hal+json":case "application/json":case "application/ld+json":case "application/problem+json":case "application/vnd.api+json":case "text/json":{let a=await n.text();return a.length>0?it(a):void 0}default:if(o.startsWith("application/vnd.")&&o.endsWith("+json")){let a=await n.text();return a.length>0?it(a):void 0}return await n.text()}}async function Bf(){return fetch}async function Vf({body:n,type:o}){return o==="form"?rr(n,{arrayFormat:"repeat",encode:true}):o.includes("json")?Se(n):n}var Le;typeof globalThis.Headers!="undefined"?Le=globalThis.Headers:Le=class Lf{constructor(o){if(this.headers=new Map,o)if(o instanceof Lf)o.forEach((e,t)=>this.append(t,e));else if(Array.isArray(o))for(let[e,t]of o)if(typeof e=="string"&&typeof t=="string")this.append(e,t);else throw new TypeError("Each header entry must be a [string, string] tuple");else for(let[e,t]of Object.entries(o))if(typeof t=="string")this.append(e,t);else throw new TypeError("Header values must be strings")}append(o,e){let t=o.toLowerCase(),i=this.headers.get(t)||[];this.headers.set(t,[...i,e]);}delete(o){let e=o.toLowerCase();this.headers.delete(e);}get(o){let e=o.toLowerCase(),t=this.headers.get(e);return t?t.join(", "):null}has(o){let e=o.toLowerCase();return this.headers.has(e)}set(o,e){let t=o.toLowerCase();this.headers.set(t,[e]);}forEach(o,e){let t=e?o.bind(e):o;this.headers.forEach((i,a)=>t(i.join(", "),a,this));}getSetCookie(){return this.headers.get("set-cookie")||[]}*entries(){for(let[o,e]of this.headers.entries())yield [o,e.join(", ")];}*keys(){yield*this.headers.keys();}*values(){for(let o of this.headers.values())yield o.join(", ");}[Symbol.iterator](){return this.entries()}};var Xb="timeout";function Hf(n){let o=new AbortController,e=setTimeout(()=>o.abort(Xb),n);return {signal:o.signal,abortId:e}}function Jf(...n){let o=n.length===1&&Array.isArray(n[0])?n[0]:n,e=new AbortController;for(let t of o){if(t.aborted){e.abort(t==null?void 0:t.reason);break}t.addEventListener("abort",()=>e.abort(t==null?void 0:t.reason),{signal:e.signal});}return e.signal}var Gf=async(n,o,e,t,i,a,s,p,l)=>{let c=[],d;if(a!=null){let{signal:u,abortId:h}=Hf(a);d=h,c.push(u);}s!=null&&c.push(s);let m=Jf(c),f=await n(o,{method:e,headers:t,body:i,signal:m,credentials:p?"include":void 0,duplex:l});return d!=null&&clearTimeout(d),f};var Li={headers:new Le,redirected:false,status:499,statusText:"Client Closed Request",type:"error",url:""},Hi={headers:new Le,redirected:false,status:0,statusText:"Unknown Error",type:"error",url:""};function Ji(n){return {headers:n.headers,redirected:n.redirected,status:n.status,statusText:n.statusText,type:n.type,url:n.url}}function Zb(n){let o=1+Math.random()*.2;return n*o}function Ob(n){let o=1+(Math.random()-.5)*.2;return n*o}function qb(n,o){let e=n.headers.get("Retry-After");if(e){let i=parseInt(e,10);if(!Number.isNaN(i)&&i>0)return Math.min(i*1e3,6e4);let a=new Date(e);if(!Number.isNaN(a.getTime())){let s=a.getTime()-Date.now();if(s>0)return Math.min(Math.max(s,0),6e4)}}let t=n.headers.get("X-RateLimit-Reset");if(t){let i=parseInt(t,10);if(!Number.isNaN(i)){let a=i*1e3-Date.now();if(a>0)return Zb(Math.min(a,6e4))}}return Ob(Math.min(1e3*2**o,6e4))}async function Kf(n,o=2){let e=await n();for(let t=0;t<o&&([408,429].includes(e.status)||e.status>=500);++t){let i=qb(e,t);await new Promise(a=>setTimeout(a,i)),e=await n();}return e}var ex=new Set(["authorization","www-authenticate","x-api-key","api-key","apikey","x-api-token","x-auth-token","auth-token","cookie","set-cookie","proxy-authorization","proxy-authenticate","x-csrf-token","x-xsrf-token","x-session-token","x-access-token"]);function gs(n){let o={};for(let[e,t]of n instanceof Le?n.entries():Object.entries(n))ex.has(e.toLowerCase())?o[e]="[REDACTED]":o[e]=t;return o}var ys=new Set(["api_key","api-key","apikey","token","access_token","access-token","auth_token","auth-token","password","passwd","secret","api_secret","api-secret","apisecret","key","session","session_id","session-id"]);function rx(n){if(n==null)return n;let o={};for(let[e,t]of Object.entries(n))ys.has(e.toLowerCase())?o[e]="[REDACTED]":o[e]=t;return o}function tr(n){let o=n.indexOf("://");if(o===-1)return n;let e=o+3,t=n.indexOf("/",e),i=n.indexOf("?",e),a=n.indexOf("#",e),s=Math.min(t===-1?n.length:t,i===-1?n.length:i,a===-1?n.length:a),p=-1;for(let h=e;h<s;h++)n[h]==="@"&&(p=h);if(p!==-1&&(n=`${n.slice(0,e)}[REDACTED]@${n.slice(p+1)}`),i=n.indexOf("?"),i===-1)return n;a=n.indexOf("#",i);let l=a!==-1?a:n.length,c=n.slice(i+1,l);if(c.length===0)return n;let d=c.toLowerCase();if(!(d.includes("token")||d.includes("key")||d.includes("password")||d.includes("passwd")||d.includes("secret")||d.includes("session")||d.includes("auth")))return n;let f=[],u=c.split("&");for(let h of u){let g=h.indexOf("=");if(g===-1){f.push(h);continue}let x=h.slice(0,g),T=ys.has(x.toLowerCase());if(!T&&x.includes("%"))try{let v=decodeURIComponent(x);T=ys.has(v.toLowerCase());}catch{}f.push(T?`${x}=[REDACTED]`:h);}return n.slice(0,i+1)+f.join("&")+n.slice(l)}async function tx(n){var e;let o=new Le;if(o.set("Accept",n.responseType==="json"?"application/json":n.responseType==="text"?"text/plain":"*/*"),n.body!==void 0&&n.contentType!=null&&o.set("Content-Type",n.contentType),n.headers==null)return o;for(let[t,i]of Object.entries(n.headers)){let a=await us.get(i,{endpointMetadata:(e=n.endpointMetadata)!=null?e:{}});if(typeof a=="string"){o.set(t,a);continue}a!=null&&o.set(t,`${a}`);}return o}async function ox(n){var s,p,l;let o=Nf(n.url,n.queryParameters),e=await Vf({body:n.body,type:(s=n.requestType)!=null?s:"other"}),t=(p=n.fetchFn)!=null?p:await Bf(),i=await tx(n),a=fs(n.logging);if(a.isDebug()){let c={method:n.method,url:tr(o),headers:gs(i),queryParameters:rx(n.queryParameters),hasBody:e!=null};a.debug("Making HTTP request",c);}try{let c=await Kf(async()=>Gf(t,o,n.method,i,e,n.timeoutMs,n.abortSignal,n.withCredentials,n.duplex),n.maxRetries);if(c.status>=200&&c.status<400){if(a.isDebug()){let m={method:n.method,url:tr(o),statusCode:c.status,responseHeaders:gs(c.headers)};a.debug("HTTP request succeeded",m);}return {ok:!0,body:await Vi(c,n.responseType),headers:c.headers,rawResponse:Ji(c)}}else {if(a.isError()){let d={method:n.method,url:tr(o),statusCode:c.status,responseHeaders:gs(Object.fromEntries(c.headers.entries()))};a.error("HTTP request failed with error status",d);}return {ok:!1,error:{reason:"status-code",statusCode:c.status,body:await Wf(c)},rawResponse:Ji(c)}}}catch(c){if((l=n.abortSignal)!=null&&l.aborted){if(a.isError()){let d={method:n.method,url:tr(o)};a.error("HTTP request was aborted",d);}return {ok:false,error:{reason:"unknown",errorMessage:"The user aborted a request"},rawResponse:Li}}else if(c instanceof Error&&c.name==="AbortError"){if(a.isError()){let d={method:n.method,url:tr(o),timeoutMs:n.timeoutMs};a.error("HTTP request timed out",d);}return {ok:false,error:{reason:"timeout"},rawResponse:Li}}else if(c instanceof Error){if(a.isError()){let d={method:n.method,url:tr(o),errorMessage:c.message};a.error("HTTP request failed with error",d);}return {ok:false,error:{reason:"unknown",errorMessage:c.message},rawResponse:Hi}}if(a.isError()){let d={method:n.method,url:tr(o),error:Se(c)};a.error("HTTP request failed with unknown error",d);}return {ok:false,error:{reason:"unknown",errorMessage:Se(c)},rawResponse:Hi}}}var k=ox;var _=class n extends Promise{constructor(o){super(e=>{e(void 0);}),this.innerPromise=o;}static fromFunction(o,...e){return new n(o(...e))}static interceptFunction(o){return (...e)=>n.fromPromise(o(...e))}static fromPromise(o){return new n(o)}static fromExecutor(o){let e=new Promise(o);return new n(e)}static fromResult(o){let e=Promise.resolve(o);return new n(e)}unwrap(){return this.unwrappedPromise||(this.unwrappedPromise=this.innerPromise.then(({data:o})=>o)),this.unwrappedPromise}then(o,e){return this.unwrap().then(o,e)}catch(o){return this.unwrap().catch(o)}finally(o){return this.unwrap().finally(o)}async withRawResponse(){return await this.innerPromise}};var b={get:async n=>typeof n=="function"?n():n};var _s={};W(_s,{toBinaryUploadRequest:()=>ix,toMultipartDataPart:()=>bs});async function ix(n){let{data:o,filename:e,contentLength:t,contentType:i}=await xs(n),a={body:o,headers:{}};return e&&(a.headers["Content-Disposition"]=`attachment; filename="${e}"`),i&&(a.headers["Content-Type"]=i),t!=null&&(a.headers["Content-Length"]=t.toString()),a}async function bs(n){let{data:o,filename:e,contentType:t}=await xs(n,{noSniffFileSize:true});return {data:o,filename:e,contentType:t}}async function xs(n,{noSniffFileSize:o}={}){var e,t,i,a,s;if(ax(n))return xs({data:n},{noSniffFileSize:o});if("path"in n){let p=await import('fs');if(!p||!p.createReadStream)throw new Error("File path uploads are not supported in this environment.");let l=p.createReadStream(n.path),c=(e=n.contentLength)!=null?e:o===true?void 0:await $f(n.path),d=(t=n.filename)!=null?t:Qf(n.path);return {data:l,filename:d,contentType:n.contentType,contentLength:c}}if("data"in n){let p=n.data,l=(i=n.contentLength)!=null?i:await sx(p,{noSniffFileSize:o}),c=(a=n.filename)!=null?a:nx(p);return {data:p,filename:c,contentType:(s=n.contentType)!=null?s:px(p),contentLength:l}}throw new Error(`Invalid FileUpload of type ${typeof n}: ${JSON.stringify(n)}`)}function ax(n){return Xf(n)||Zf(n)||Of(n)||dx(n)||Rs(n)||ws(n)||lx(n)||mx(n)}async function $f(n){try{let o=await import('fs');return !o||!o.promises||!o.promises.stat?void 0:(await o.promises.stat(n)).size}catch{return}}function nx(n){if(cx(n))return n.name;if(Yf(n))return Qf(n.path.toString())}async function sx(n,{noSniffFileSize:o}={}){if(Xf(n))return n.length;if(Zf(n)||Of(n))return n.byteLength;if(Rs(n)||ws(n))return n.size;if(o!==true&&Yf(n))return await $f(n.path.toString())}function px(n){if(Rs(n)||ws(n))return n.type}function Qf(n){let o=n.lastIndexOf("/"),e=n.lastIndexOf("\\"),t=Math.max(o,e);return t>=0?n.substring(t+1):n}function cx(n){return typeof n=="object"&&n!=null&&"name"in n}function Yf(n){return typeof n=="object"&&n!=null&&"path"in n}function lx(n){return typeof n=="object"&&n!=null&&("read"in n||"pipe"in n)}function mx(n){return typeof n=="object"&&n!=null&&"getReader"in n}function Xf(n){return typeof Buffer!="undefined"&&Buffer.isBuffer&&Buffer.isBuffer(n)}function Zf(n){return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView(n)}function Of(n){return typeof ArrayBuffer!="undefined"&&n instanceof ArrayBuffer}function dx(n){return typeof Uint8Array!="undefined"&&n instanceof Uint8Array}function Rs(n){return typeof Blob!="undefined"&&n instanceof Blob}function ws(n){return typeof File!="undefined"&&n instanceof File}var Ar=ux();function ux(){var l,c,d,m,f;return typeof window!="undefined"&&typeof window.document!="undefined"?{type:"browser",version:window.navigator.userAgent}:typeof globalThis!="undefined"&&((l=globalThis==null?void 0:globalThis.navigator)==null?void 0:l.userAgent)==="Cloudflare-Workers"?{type:"workerd"}:typeof EdgeRuntime=="string"?{type:"edge-runtime"}:typeof self=="object"&&typeof(self==null?void 0:self.importScripts)=="function"&&(((c=self.constructor)==null?void 0:c.name)==="DedicatedWorkerGlobalScope"||((d=self.constructor)==null?void 0:d.name)==="ServiceWorkerGlobalScope"||((m=self.constructor)==null?void 0:m.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 navigator!="undefined"&&(navigator==null?void 0:navigator.product)==="ReactNative"?{type:"react-native"}:typeof process!="undefined"&&"version"in process&&!!process.version&&"versions"in process&&!!((f=process.versions)!=null&&f.node)?{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])}:{type:"unknown"}}async function qf(){return new zs}var zs=class{constructor(){this.fd=new FormData;}async setup(){}append(o,e){this.fd.append(o,String(e));}async appendFile(o,e){let{data:t,filename:i,contentType:a}=await bs(e),s=await bx(t,a);i?this.fd.append(o,s,i):this.fd.append(o,s);}getRequest(){return {body:this.fd,headers:{},duplex:"half"}}};function fx(n){return typeof n=="object"&&n!=null&&("read"in n||"pipe"in n)}function eh(n){return typeof n=="object"&&n!=null&&"getReader"in n}function hx(n){return typeof Buffer!="undefined"&&Buffer.isBuffer&&Buffer.isBuffer(n)}function gx(n){return ArrayBuffer.isView(n)}async function yx(n){if(Ar.type==="node"){let{Readable:o}=await import('stream');if(n instanceof o){let e=[];for await(let t of n)e.push(Buffer.isBuffer(t)?t:Buffer.from(t));return Buffer.concat(e)}}if(eh(n)){let o=n.getReader(),e=[];try{for(;;){let{done:s,value:p}=await o.read();if(s)break;e.push(p);}}finally{o.releaseLock();}let t=e.reduce((s,p)=>s+p.length,0),i=new Uint8Array(t),a=0;for(let s of e)i.set(s,a),a+=s.length;return Buffer.from(i)}throw new Error(`Unsupported stream type: ${typeof n}. Expected Node.js Readable stream or Web ReadableStream.`)}async function bx(n,o){if(fx(n)||eh(n)){let e=await yx(n);return new Blob([e],{type:o})}return n instanceof Blob?n:hx(n)?new Blob([n],{type:o}):n instanceof ArrayBuffer?new Blob([n],{type:o}):gx(n)?new Blob([n],{type:o}):typeof n=="string"?new Blob([n],{type:o}):typeof n=="object"&&n!==null?new Blob([Se(n)],{type:o!=null?o:"application/json"}):new Blob([String(n)],{type:o})}var at={};W(at,{ConsoleLogger:()=>er,LogLevel:()=>fe,Logger:()=>Pr,createLogger:()=>fs});var r={};W(r,{JsonError:()=>Tr,ParseError:()=>vr,any:()=>hh,bigint:()=>th,boolean:()=>gh,booleanLiteral:()=>uh,date:()=>oh,discriminant:()=>Ph,enum_:()=>Ki,getObjectLikeUtils:()=>Pe,getObjectUtils:()=>or,getSchemaUtils:()=>J,isProperty:()=>He,lazy:()=>ih,lazyObject:()=>mh,list:()=>Qi,never:()=>yh,number:()=>bh,object:()=>$i,objectWithoutOptionalProperties:()=>lh,optional:()=>ks,property:()=>nh,record:()=>_h,set:()=>zh,string:()=>xh,stringLiteral:()=>fh,transform:()=>Ss,undiscriminatedUnion:()=>Sh,union:()=>Th,unknown:()=>Rh,withParsedProperties:()=>As});var N={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",NEVER:"never",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"};function L(n,o){return `Expected ${o}. Received ${xx(n)}.`}function xx(n){if(Array.isArray(n))return "list";if(n===null)return "null";if(n instanceof BigInt)return "BigInt";switch(typeof n){case "string":return `"${n}"`;case "bigint":case "number":case "boolean":case "undefined":return `${n}`}return typeof n}function te(n){return {...n,json:rh(n.json),parse:rh(n.parse)}}function rh(n){return (o,e)=>{let t=n(o,e),{skipValidation:i=false}=e!=null?e:{};return !t.ok&&i?(console.warn(["Failed to validate.",...t.errors.map(a=>" - "+(a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message))].join(`
|
|
3
|
+
`)),{ok:true,value:o}):t}}function Gi(n){return n.path.length===0?n.message:`${n.path.join(" -> ")}: ${n.message}`}var Tr=class n extends Error{constructor(e){super(e.map(Gi).join("; "));this.errors=e;Object.setPrototypeOf(this,n.prototype);}};var vr=class n extends Error{constructor(e){super(e.map(Gi).join("; "));this.errors=e;Object.setPrototypeOf(this,n.prototype);}};function J(n){return {nullable:()=>Rx(n),optional:()=>ks(n),optionalNullable:()=>wx(n),transform:o=>Ss(n,o),parseOrThrow:(o,e)=>{let t=n.parse(o,e);if(t.ok)return t.value;throw new vr(t.errors)},jsonOrThrow:(o,e)=>{let t=n.json(o,e);if(t.ok)return t.value;throw new Tr(t.errors)}}}function Rx(n){let o={parse:(e,t)=>e==null?{ok:true,value:null}:n.parse(e,t),json:(e,t)=>e==null?{ok:true,value:null}:n.json(e,t),getType:()=>N.NULLABLE};return {...o,...J(o)}}function ks(n){let o={parse:(e,t)=>e==null?{ok:true,value:void 0}:n.parse(e,t),json:(e,t)=>t!=null&&t.omitUndefined&&e===void 0?{ok:true,value:void 0}:e==null?{ok:true,value:null}:n.json(e,t),getType:()=>N.OPTIONAL};return {...o,...J(o)}}function wx(n){let o={parse:(e,t)=>e===void 0?{ok:true,value:void 0}:e===null?{ok:true,value:null}:n.parse(e,t),json:(e,t)=>e===void 0?{ok:true,value:void 0}:e===null?{ok:true,value:null}:n.json(e,t),getType:()=>N.OPTIONAL_NULLABLE};return {...o,...J(o)}}function Ss(n,o){let e={parse:(t,i)=>{let a=n.parse(t,i);return a.ok?{ok:true,value:o.transform(a.value)}:a},json:(t,i)=>{let a=o.untransform(t);return n.json(a,i)},getType:()=>n.getType()};return {...e,...J(e)}}function th(){let n={parse:(o,{breadcrumbsPrefix:e=[]}={})=>typeof o=="bigint"?{ok:true,value:o}:typeof o=="number"?{ok:true,value:BigInt(o)}:{ok:false,errors:[{path:e,message:L(o,"bigint | number")}]},json:(o,{breadcrumbsPrefix:e=[]}={})=>typeof o!="bigint"?{ok:false,errors:[{path:e,message:L(o,"bigint")}]}:{ok:true,value:o},getType:()=>N.BIGINT};return {...te(n),...J(n)}}var _x=/^([+-]?\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 oh(){let n={parse:(o,{breadcrumbsPrefix:e=[]}={})=>typeof o!="string"?{ok:false,errors:[{path:e,message:L(o,"string")}]}:_x.test(o)?{ok:true,value:new Date(o)}:{ok:false,errors:[{path:e,message:L(o,"ISO 8601 date string")}]},json:(o,{breadcrumbsPrefix:e=[]}={})=>o instanceof Date?{ok:true,value:o.toISOString()}:{ok:false,errors:[{path:e,message:L(o,"Date object")}]},getType:()=>N.DATE};return {...te(n),...J(n)}}function oe(n,o){return ()=>{let e={parse:o,json:o,getType:()=>n};return {...te(e),...J(e)}}}function Ki(n){let o=new Set(n);return oe(N.ENUM,(t,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:a=[]}={})=>typeof t!="string"?{ok:false,errors:[{path:a,message:L(t,"string")}]}:!o.has(t)&&!i?{ok:false,errors:[{path:a,message:L(t,"enum")}]}:{ok:true,value:t})()}function ih(n){let o=Ps(n);return {...o,...J(o)}}function Ps(n){return {parse:(o,e)=>jr(n).parse(o,e),json:(o,e)=>jr(n).json(o,e),getType:()=>jr(n).getType()}}function jr(n){let o=n;return o.__zurg_memoized==null&&(o.__zurg_memoized=n()),o.__zurg_memoized}function nt(n){return Object.entries(n)}function st(n,o){let e=new Set(o);return Object.entries(n).reduce((t,[i,a])=>(e.has(i)&&(t[i]=a),t),{})}function Ie(n){if(typeof n!="object"||n===null)return false;if(Object.getPrototypeOf(n)===null)return true;let o=n;for(;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return Object.getPrototypeOf(n)===o}function pt(n){return Object.keys(n)}function ah(n,o){let e=[],t=[];for(let i of n)o(i)?e.push(i):t.push(i);return [e,t]}function Pe(n){return {withParsedProperties:o=>As(n,o)}}function As(n,o){let e={parse:(t,i)=>{let a=n.parse(t,i);if(!a.ok)return a;let s=Object.entries(o).reduce((p,[l,c])=>({...p,[l]:typeof c=="function"?c(a.value):c}),{});return {ok:true,value:{...a.value,...s}}},json:(t,i)=>{var p;if(!Ie(t))return {ok:false,errors:[{path:(p=i==null?void 0:i.breadcrumbsPrefix)!=null?p:[],message:L(t,"object")}]};let a=new Set(Object.keys(o)),s=st(t,Object.keys(t).filter(l=>!a.has(l)));return n.json(s,i)},getType:()=>n.getType()};return {...e,...J(e),...Pe(e)}}function nh(n,o){return {rawKey:n,valueSchema:o,isProperty:true}}function He(n){return n.isProperty}function $i(n){let o={_getRawProperties:()=>Object.entries(n).map(([e,t])=>He(t)?t.rawKey:e),_getParsedProperties:()=>pt(n),parse:(e,t)=>{let i={},a=[];for(let[s,p]of nt(n)){let l=He(p)?p.rawKey:s,c=He(p)?p.valueSchema:p,d={rawKey:l,parsedKey:s,valueSchema:c};i[l]=d,ch(c)&&a.push(l);}return sh({value:e,requiredKeys:a,getProperty:s=>{let p=i[s];if(p!=null)return {transformedKey:p.parsedKey,transform:l=>{var c;return p.valueSchema.parse(l,{...t,breadcrumbsPrefix:[...(c=t==null?void 0:t.breadcrumbsPrefix)!=null?c:[],s]})}}},unrecognizedObjectKeys:t==null?void 0:t.unrecognizedObjectKeys,skipValidation:t==null?void 0:t.skipValidation,breadcrumbsPrefix:t==null?void 0:t.breadcrumbsPrefix,omitUndefined:t==null?void 0:t.omitUndefined})},json:(e,t)=>{let i=[];for(let[a,s]of nt(n)){let p=He(s)?s.valueSchema:s;ch(p)&&i.push(a);}return sh({value:e,requiredKeys:i,getProperty:a=>{let s=n[a];if(s!=null)return He(s)?{transformedKey:s.rawKey,transform:p=>{var l;return s.valueSchema.json(p,{...t,breadcrumbsPrefix:[...(l=t==null?void 0:t.breadcrumbsPrefix)!=null?l:[],a]})}}:{transformedKey:a,transform:p=>{var l;return s.json(p,{...t,breadcrumbsPrefix:[...(l=t==null?void 0:t.breadcrumbsPrefix)!=null?l:[],a]})}}},unrecognizedObjectKeys:t==null?void 0:t.unrecognizedObjectKeys,skipValidation:t==null?void 0:t.skipValidation,breadcrumbsPrefix:t==null?void 0:t.breadcrumbsPrefix,omitUndefined:t==null?void 0:t.omitUndefined})},getType:()=>N.OBJECT};return {...te(o),...J(o),...Pe(o),...or(o)}}function sh({value:n,requiredKeys:o,getProperty:e,unrecognizedObjectKeys:t="fail",skipValidation:i=false,breadcrumbsPrefix:a=[]}){if(!Ie(n))return {ok:false,errors:[{path:a,message:L(n,"object")}]};let s=new Set(o),p=[],l={};for(let[c,d]of Object.entries(n)){let m=e(c);if(m!=null){s.delete(c);let f=m.transform(d);f.ok?l[m.transformedKey]=f.value:(l[c]=d,p.push(...f.errors));}else switch(t){case "fail":p.push({path:[...a,c],message:`Unexpected key "${c}"`});break;case "strip":break;case "passthrough":l[c]=d;break}}return p.push(...o.filter(c=>s.has(c)).map(c=>({path:a,message:`Missing required key "${c}"`}))),p.length===0||i?{ok:true,value:l}:{ok:false,errors:p}}function or(n){return {extend:o=>{let e={_getParsedProperties:()=>[...n._getParsedProperties(),...o._getParsedProperties()],_getRawProperties:()=>[...n._getRawProperties(),...o._getRawProperties()],parse:(t,i)=>ph({extensionKeys:o._getRawProperties(),value:t,transformBase:a=>n.parse(a,i),transformExtension:a=>o.parse(a,i),breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),json:(t,i)=>ph({extensionKeys:o._getParsedProperties(),value:t,transformBase:a=>n.json(a,i),transformExtension:a=>o.json(a,i),breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),getType:()=>N.OBJECT};return {...e,...J(e),...Pe(e),...or(e)}},passthrough:()=>{let o=new Set(n._getRawProperties()),e=new Set(n._getParsedProperties()),t={_getParsedProperties:()=>n._getParsedProperties(),_getRawProperties:()=>n._getRawProperties(),parse:(i,a)=>{let s=n.parse(i,{...a,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let p={};if(typeof i=="object"&&i!=null)for(let[l,c]of Object.entries(i))o.has(l)||(p[l]=c);return {ok:true,value:{...p,...s.value}}},json:(i,a)=>{let s=n.json(i,{...a,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let p={};if(typeof i=="object"&&i!=null)for(let[l,c]of Object.entries(i))e.has(l)||(p[l]=c);return {ok:true,value:{...p,...s.value}}},getType:()=>N.OBJECT};return {...t,...J(t),...Pe(t),...or(t)}}}}function ph({extensionKeys:n,value:o,transformBase:e,transformExtension:t,breadcrumbsPrefix:i=[]}){if(!Ie(o))return {ok:false,errors:[{path:i,message:L(o,"object")}]};let a=new Set(n),[s,p]=ah(pt(o),d=>a.has(d)),l=e(st(o,p)),c=t(st(o,s));return l.ok&&c.ok?{ok:true,value:{...l.value,...c.value}}:{ok:false,errors:[...l.ok?[]:l.errors,...c.ok?[]:c.errors]}}function ch(n){return !zx(n)}function zx(n){switch(n.getType()){case N.ANY:case N.UNKNOWN:case N.OPTIONAL:case N.OPTIONAL_NULLABLE:return true;default:return false}}function lh(n){return $i(n)}function mh(n){let o={...Ps(n),_getRawProperties:()=>jr(n)._getRawProperties(),_getParsedProperties:()=>jr(n)._getParsedProperties()};return {...o,...J(o),...Pe(o),...or(o)}}function Qi(n){let o={parse:(e,t)=>dh(e,(i,a)=>{var s;return n.parse(i,{...t,breadcrumbsPrefix:[...(s=t==null?void 0:t.breadcrumbsPrefix)!=null?s:[],`[${a}]`]})}),json:(e,t)=>dh(e,(i,a)=>{var s;return n.json(i,{...t,breadcrumbsPrefix:[...(s=t==null?void 0:t.breadcrumbsPrefix)!=null?s:[],`[${a}]`]})}),getType:()=>N.LIST};return {...te(o),...J(o)}}function dh(n,o){return Array.isArray(n)?n.map((t,i)=>o(t,i)).reduce((t,i)=>{if(t.ok&&i.ok)return {ok:true,value:[...t.value,i.value]};let a=[];return t.ok||a.push(...t.errors),i.ok||a.push(...i.errors),{ok:false,errors:a}},{ok:true,value:[]}):{ok:false,errors:[{message:L(n,"list"),path:[]}]}}function uh(n){return oe(N.BOOLEAN_LITERAL,(e,{breadcrumbsPrefix:t=[]}={})=>e===n?{ok:true,value:n}:{ok:false,errors:[{path:t,message:L(e,`${n.toString()}`)}]})()}function fh(n){return oe(N.STRING_LITERAL,(e,{breadcrumbsPrefix:t=[]}={})=>e===n?{ok:true,value:n}:{ok:false,errors:[{path:t,message:L(e,`"${n}"`)}]})()}var hh=oe(N.ANY,n=>({ok:true,value:n}));var gh=oe(N.BOOLEAN,(n,{breadcrumbsPrefix:o=[]}={})=>typeof n=="boolean"?{ok:true,value:n}:{ok:false,errors:[{path:o,message:L(n,"boolean")}]});var yh=oe(N.NEVER,(n,{breadcrumbsPrefix:o=[]}={})=>({ok:false,errors:[{path:o,message:"Expected never"}]}));var bh=oe(N.NUMBER,(n,{breadcrumbsPrefix:o=[]}={})=>typeof n=="number"?{ok:true,value:n}:{ok:false,errors:[{path:o,message:L(n,"number")}]});var xh=oe(N.STRING,(n,{breadcrumbsPrefix:o=[]}={})=>typeof n=="string"?{ok:true,value:n}:{ok:false,errors:[{path:o,message:L(n,"string")}]});var Rh=oe(N.UNKNOWN,n=>({ok:true,value:n}));function _h(n,o){let e={parse:(t,i)=>wh({value:t,isKeyNumeric:n.getType()===N.NUMBER,transformKey:a=>{var s;return n.parse(a,{...i,breadcrumbsPrefix:[...(s=i==null?void 0:i.breadcrumbsPrefix)!=null?s:[],`${a} (key)`]})},transformValue:(a,s)=>{var p;return o.parse(a,{...i,breadcrumbsPrefix:[...(p=i==null?void 0:i.breadcrumbsPrefix)!=null?p:[],`${s}`]})},breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),json:(t,i)=>wh({value:t,isKeyNumeric:n.getType()===N.NUMBER,transformKey:a=>{var s;return n.json(a,{...i,breadcrumbsPrefix:[...(s=i==null?void 0:i.breadcrumbsPrefix)!=null?s:[],`${a} (key)`]})},transformValue:(a,s)=>{var p;return o.json(a,{...i,breadcrumbsPrefix:[...(p=i==null?void 0:i.breadcrumbsPrefix)!=null?p:[],`${s}`]})},breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),getType:()=>N.RECORD};return {...te(e),...J(e)}}function wh({value:n,isKeyNumeric:o,transformKey:e,transformValue:t,breadcrumbsPrefix:i=[]}){return Ie(n)?nt(n).reduce((a,[s,p])=>{if(p===void 0)return a;let l=a,c=s;if(o){let u=s.length>0?Number(s):NaN;Number.isNaN(u)||(c=u);}let d=e(c),m=t(p,c);if(l.ok&&d.ok&&m.ok)return {ok:true,value:{...l.value,[d.value]:m.value}};let f=[];return l.ok||f.push(...l.errors),d.ok||f.push(...d.errors),m.ok||f.push(...m.errors),{ok:false,errors:f}},{ok:true,value:{}}):{ok:false,errors:[{path:i,message:L(n,"object")}]}}function zh(n){let o=Qi(n),e={parse:(t,i)=>{let a=o.parse(t,i);return a.ok?{ok:true,value:new Set(a.value)}:a},json:(t,i)=>{var s;return t instanceof Set?o.json([...t],i):{ok:false,errors:[{path:(s=i==null?void 0:i.breadcrumbsPrefix)!=null?s:[],message:L(t,"Set")}]}},getType:()=>N.SET};return {...te(e),...J(e)}}function Sh(n){let o={parse:(e,t)=>kh((i,a)=>i.parse(e,a),n,t),json:(e,t)=>kh((i,a)=>i.json(e,a),n,t),getType:()=>N.UNDISCRIMINATED_UNION};return {...te(o),...J(o)}}function kh(n,o,e){let t=[];for(let[i,a]of o.entries()){let s=n(a,{...e,skipValidation:false});if(s.ok)return s;for(let p of s.errors)t.push({path:p.path,message:`[Variant ${i}] ${p.message}`});}return {ok:false,errors:t}}function Ph(n,o){return {parsedDiscriminant:n,rawDiscriminant:o}}function Th(n,o){let e=typeof n=="string"?n:n.rawDiscriminant,t=typeof n=="string"?n:n.parsedDiscriminant,i=Ki(pt(o)),a={parse:(s,p)=>Ah({value:s,discriminant:e,transformedDiscriminant:t,transformDiscriminantValue:l=>{var c;return i.parse(l,{allowUnrecognizedEnumValues:p==null?void 0:p.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(c=p==null?void 0:p.breadcrumbsPrefix)!=null?c:[],e]})},getAdditionalPropertiesSchema:l=>o[l],allowUnrecognizedUnionMembers:p==null?void 0:p.allowUnrecognizedUnionMembers,transformAdditionalProperties:(l,c)=>c.parse(l,p),breadcrumbsPrefix:p==null?void 0:p.breadcrumbsPrefix}),json:(s,p)=>Ah({value:s,discriminant:t,transformedDiscriminant:e,transformDiscriminantValue:l=>{var c;return i.json(l,{allowUnrecognizedEnumValues:p==null?void 0:p.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(c=p==null?void 0:p.breadcrumbsPrefix)!=null?c:[],t]})},getAdditionalPropertiesSchema:l=>o[l],allowUnrecognizedUnionMembers:p==null?void 0:p.allowUnrecognizedUnionMembers,transformAdditionalProperties:(l,c)=>c.json(l,p),breadcrumbsPrefix:p==null?void 0:p.breadcrumbsPrefix}),getType:()=>N.UNION};return {...te(a),...J(a),...Pe(a)}}function Ah({value:n,discriminant:o,transformedDiscriminant:e,transformDiscriminantValue:t,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:a=false,transformAdditionalProperties:s,breadcrumbsPrefix:p=[]}){if(!Ie(n))return {ok:false,errors:[{path:p,message:L(n,"object")}]};let{[o]:l,...c}=n;if(l==null)return {ok:false,errors:[{path:p,message:`Missing discriminant ("${o}")`}]};let d=t(l);if(!d.ok)return {ok:false,errors:d.errors};let m=i(d.value);if(m==null)return a?{ok:true,value:{[e]:d.value,...c}}:{ok:false,errors:[{path:[...p,o],message:"Unexpected discriminant value"}]};let f=s(c,m);return f.ok?{ok:true,value:{[e]:l,...f.value}}:f}var R={};W(R,{encodePathParam:()=>vh,join:()=>Eh,toQueryString:()=>rr});function vh(n){if(n===null)return "null";switch(typeof n){case "undefined":return "undefined";case "string":case "number":case "boolean":break;default:n=String(n);break}return encodeURIComponent(n)}function Eh(n,...o){if(!n)return "";if(o.length===0)return n;if(n.includes("://")){let e;try{e=new URL(n);}catch{return jh(n,...o)}let t=o[o.length-1],i=t==null?void 0:t.endsWith("/");for(let a of o){let s=Ih(a);s&&(e.pathname=Ch(e.pathname,s));}return i&&!e.pathname.endsWith("/")&&(e.pathname+="/"),e.toString()}return jh(n,...o)}function jh(n,...o){if(o.length===0)return n;let e=n,t=o[o.length-1],i=t==null?void 0:t.endsWith("/");for(let a of o){let s=Ih(a);s&&(e=Ch(e,s));}return i&&!e.endsWith("/")&&(e+="/"),e}function Ch(n,o){return n.endsWith("/")?n+o:`${n}/${o}`}function Ih(n){if(!n)return n;let o=0,e=n.length;return n.startsWith("/")&&(o=1),n.endsWith("/")&&(e=n.length-1),o===0&&e===n.length?n:n.slice(o,e)}function F(n){let o=z({"X-Fern-Language":"JavaScript","X-Fern-Runtime":Ar.type,"X-Fern-Runtime-Version":Ar.version,"Comet-Workspace":n==null?void 0:n.workspaceName},n==null?void 0:n.headers);return {...n,logging:at.createLogger(n==null?void 0:n.logging),headers:o}}var S={Default:"http://localhost:5173/api"};function A(n,o,e,t){switch(n.reason){case "non-json":throw new w({statusCode:n.statusCode,body:n.rawBody,rawResponse:o});case "body-is-null":throw new w({statusCode:n.statusCode,rawResponse:o});case "timeout":throw new Sr(`Timeout exceeded when calling ${e} ${t}.`);case "unknown":throw new w({message:n.errorMessage,rawResponse:o});default:throw new w({message:"Unknown error",rawResponse:o})}}var H={};W(H,{AggregationData:()=>bp,Alert:()=>jx,AlertAlertType:()=>xp,AlertPagePublic:()=>Ep,AlertPublic:()=>zo,AlertPublicAlertType:()=>Sp,AlertTrigger:()=>zp,AlertTriggerConfig:()=>wp,AlertTriggerConfigPublic:()=>Ap,AlertTriggerConfigPublicType:()=>Pp,AlertTriggerConfigType:()=>Rp,AlertTriggerConfigWrite:()=>Ip,AlertTriggerConfigWriteType:()=>Cp,AlertTriggerEventType:()=>_p,AlertTriggerPublic:()=>vp,AlertTriggerPublicEventType:()=>Tp,AlertTriggerWrite:()=>Up,AlertTriggerWriteEventType:()=>Dp,AlertWrite:()=>ko,AlertWriteAlertType:()=>Fp,AnnotationQueue:()=>Bp,AnnotationQueueBatch:()=>Ex,AnnotationQueueBatchWrite:()=>lt,AnnotationQueueItemIds:()=>Fa,AnnotationQueuePagePublic:()=>Hp,AnnotationQueuePublic:()=>So,AnnotationQueuePublicScope:()=>Vp,AnnotationQueueReviewer:()=>Mp,AnnotationQueueReviewerPublic:()=>Lp,AnnotationQueueScope:()=>Wp,AnnotationQueueUpdate:()=>mt,AnnotationQueueWrite:()=>ct,AnnotationQueueWriteScope:()=>Ts,AssistantMessage:()=>Kp,AssistantMessageRole:()=>Jp,Attachment:()=>$p,AttachmentListRequestEntityType:()=>ea,AttachmentPage:()=>Qp,AudioUrl:()=>Yp,AudioUrlPublic:()=>Xp,AudioUrlWrite:()=>Zp,AuthDetailsHolder:()=>Op,AutomationRuleEvaluator:()=>Cx,AutomationRuleEvaluatorAction:()=>qp,AutomationRuleEvaluatorLlmAsJudge:()=>nc,AutomationRuleEvaluatorLlmAsJudgePublic:()=>Io,AutomationRuleEvaluatorLlmAsJudgeWrite:()=>Ac,AutomationRuleEvaluatorObjectObjectPublic:()=>Dc,AutomationRuleEvaluatorObjectObjectPublicAction:()=>Tc,AutomationRuleEvaluatorPagePublic:()=>Uc,AutomationRuleEvaluatorPublic:()=>Nc,AutomationRuleEvaluatorPublicAction:()=>Fc,AutomationRuleEvaluatorSpanLlmAsJudge:()=>pc,AutomationRuleEvaluatorSpanLlmAsJudgePublic:()=>Uo,AutomationRuleEvaluatorSpanLlmAsJudgeWrite:()=>Bc,AutomationRuleEvaluatorSpanUserDefinedMetricPython:()=>cc,AutomationRuleEvaluatorSpanUserDefinedMetricPythonPublic:()=>Fo,AutomationRuleEvaluatorSpanUserDefinedMetricPythonWrite:()=>Lc,AutomationRuleEvaluatorTraceThreadLlmAsJudge:()=>lc,AutomationRuleEvaluatorTraceThreadLlmAsJudgePublic:()=>No,AutomationRuleEvaluatorTraceThreadLlmAsJudgeWrite:()=>Gc,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPython:()=>mc,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonPublic:()=>Mo,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonWrite:()=>$c,AutomationRuleEvaluatorUpdate:()=>rl,AutomationRuleEvaluatorUpdateAction:()=>Qc,AutomationRuleEvaluatorUpdateLlmAsJudge:()=>Yc,AutomationRuleEvaluatorUpdateSpanLlmAsJudge:()=>Xc,AutomationRuleEvaluatorUpdateSpanUserDefinedMetricPython:()=>Zc,AutomationRuleEvaluatorUpdateTraceThreadLlmAsJudge:()=>Oc,AutomationRuleEvaluatorUpdateTraceThreadUserDefinedMetricPython:()=>qc,AutomationRuleEvaluatorUpdateUserDefinedMetricPython:()=>el,AutomationRuleEvaluatorUserDefinedMetricPython:()=>dc,AutomationRuleEvaluatorUserDefinedMetricPythonPublic:()=>Wo,AutomationRuleEvaluatorUserDefinedMetricPythonWrite:()=>ol,AutomationRuleEvaluatorWrite:()=>al,AutomationRuleEvaluatorWriteAction:()=>il,AvgValueStatPublic:()=>nl,BatchDelete:()=>Y,BatchDeleteByProject:()=>Ix,BiInformation:()=>sl,BiInformationResponse:()=>Vr,BooleanFeedbackDefinition:()=>cl,BooleanFeedbackDefinitionCreate:()=>ml,BooleanFeedbackDefinitionPublic:()=>Ho,BooleanFeedbackDefinitionUpdate:()=>fl,BooleanFeedbackDetail:()=>pl,BooleanFeedbackDetailCreate:()=>ll,BooleanFeedbackDetailPublic:()=>dl,BooleanFeedbackDetailUpdate:()=>ul,CategoricalFeedbackDefinition:()=>gl,CategoricalFeedbackDefinitionCreate:()=>bl,CategoricalFeedbackDefinitionPublic:()=>Jo,CategoricalFeedbackDefinitionUpdate:()=>wl,CategoricalFeedbackDetail:()=>hl,CategoricalFeedbackDetailCreate:()=>yl,CategoricalFeedbackDetailPublic:()=>xl,CategoricalFeedbackDetailUpdate:()=>Rl,ChatCompletionChoice:()=>zl,ChatCompletionRequest:()=>ft,ChatCompletionResponse:()=>Al,Check:()=>jl,CheckName:()=>Tl,CheckPublic:()=>Il,CheckPublicName:()=>El,CheckPublicResult:()=>Cl,CheckResult:()=>vl,ChunkedOutputJsonNode:()=>Dx,ChunkedOutputJsonNodePublic:()=>Ux,ChunkedOutputJsonNodePublicType:()=>Ul,ChunkedOutputJsonNodeType:()=>Dl,Column:()=>Nl,ColumnCompare:()=>Wl,ColumnCompareTypesItem:()=>Ml,ColumnPublic:()=>Vl,ColumnPublicTypesItem:()=>Bl,ColumnTypesItem:()=>Fl,Comment:()=>O,CommentCompare:()=>Ll,CommentPublic:()=>gr,CompleteMultipartUploadRequest:()=>Na,CompleteMultipartUploadRequestEntityType:()=>Hl,CompletionTokensDetails:()=>kl,CountValueStatPublic:()=>Gl,CreateDatasetItemsFromSpansRequest:()=>yt,CreateDatasetItemsFromTracesRequest:()=>bt,CreatePromptVersionDetail:()=>Ot,CreatePromptVersionDetailTemplateStructure:()=>ka,DashboardPagePublic:()=>Kl,DashboardPublic:()=>yr,DashboardUpdatePublic:()=>ht,DashboardWrite:()=>gt,DataPointDouble:()=>Fx,DataPointNumberPublic:()=>$l,Dataset:()=>Nx,DatasetExpansion:()=>Mx,DatasetExpansionResponse:()=>Zl,DatasetExpansionWrite:()=>xt,DatasetExportJobPublic:()=>Cr,DatasetExportJobPublicStatus:()=>Vs,DatasetIdentifier:()=>Rt,DatasetIdentifierPublic:()=>wt,DatasetItem:()=>Ko,DatasetItemBatch:()=>Wx,DatasetItemBatchUpdate:()=>zt,DatasetItemBatchWrite:()=>St,DatasetItemChangesPublic:()=>Ol,DatasetItemCompare:()=>nm,DatasetItemCompareSource:()=>ql,DatasetItemFilter:()=>_t,DatasetItemFilterOperator:()=>Ms,DatasetItemPageCompare:()=>sm,DatasetItemPagePublic:()=>lm,DatasetItemPublic:()=>Qo,DatasetItemPublicSource:()=>pm,DatasetItemSource:()=>Xl,DatasetItemStreamRequest:()=>Pt,DatasetItemUpdate:()=>Ws,DatasetItemWrite:()=>kt,DatasetItemWriteSource:()=>Bs,DatasetItemsDelete:()=>At,DatasetPagePublic:()=>um,DatasetPublic:()=>Lr,DatasetPublicStatus:()=>mm,DatasetPublicVisibility:()=>dm,DatasetStatus:()=>Ql,DatasetUpdate:()=>Tt,DatasetUpdateVisibility:()=>aa,DatasetVersionDiff:()=>hm,DatasetVersionDiffStats:()=>fm,DatasetVersionPagePublic:()=>gm,DatasetVersionPublic:()=>br,DatasetVersionRestorePublic:()=>vt,DatasetVersionSummary:()=>Go,DatasetVersionSummaryPublic:()=>Yo,DatasetVersionTag:()=>jt,DatasetVersionUpdatePublic:()=>Et,DatasetVisibility:()=>Yl,DatasetWrite:()=>Ct,DatasetWriteVisibility:()=>na,DeleteAttachmentsRequest:()=>Bx,DeleteAttachmentsRequestEntityType:()=>ym,DeleteFeedbackScore:()=>Xo,DeleteIdsHolder:()=>Hr,DeleteThreadFeedbackScores:()=>co,DeleteTraceThreads:()=>lo,Delta:()=>_l,DownloadAttachmentRequestEntityType:()=>ra,ErrorCountWithDeviation:()=>Zo,ErrorCountWithDeviationDetailed:()=>bm,ErrorInfo:()=>Ne,ErrorInfoExperimentItemBulkWriteView:()=>Ft,ErrorInfoPublic:()=>Oo,ErrorInfoWrite:()=>ao,ErrorMessage:()=>de,ErrorMessageDetail:()=>Vx,ErrorMessageDetailed:()=>Lx,ErrorMessagePublic:()=>Hx,Experiment:()=>Jx,ExperimentBatchUpdate:()=>Ut,ExperimentGroupAggregationsResponse:()=>_m,ExperimentGroupResponse:()=>Pm,ExperimentItem:()=>Wt,ExperimentItemBulkRecord:()=>jm,ExperimentItemBulkRecordExperimentItemBulkWriteView:()=>Zs,ExperimentItemBulkUpload:()=>Gx,ExperimentItemBulkUploadExperimentItemBulkWriteView:()=>Nt,ExperimentItemCompare:()=>am,ExperimentItemCompareTraceVisibilityMode:()=>em,ExperimentItemPublic:()=>$o,ExperimentItemPublicTraceVisibilityMode:()=>cm,ExperimentItemStreamRequest:()=>Mt,ExperimentItemTraceVisibilityMode:()=>Os,ExperimentItemsBatch:()=>Bt,ExperimentItemsDelete:()=>Vt,ExperimentPagePublic:()=>Dm,ExperimentPublic:()=>ti,ExperimentPublicStatus:()=>Em,ExperimentPublicType:()=>Cm,ExperimentScore:()=>It,ExperimentScorePublic:()=>Im,ExperimentScoreWrite:()=>tp,ExperimentStatus:()=>xm,ExperimentStreamRequestPublic:()=>Lt,ExperimentType:()=>Rm,ExperimentUpdate:()=>Dt,ExperimentUpdateStatus:()=>Ls,ExperimentUpdateType:()=>Hs,ExperimentWrite:()=>Ht,ExperimentWriteStatus:()=>ca,ExperimentWriteType:()=>la,ExportTraceServiceRequest:()=>Kx,Feedback:()=>$x,FeedbackCreate:()=>Vm,FeedbackDefinitionPagePublic:()=>Gm,FeedbackObjectPublic:()=>Jm,FeedbackPublic:()=>$m,FeedbackScore:()=>se,FeedbackScoreAverage:()=>me,FeedbackScoreAverageDetailed:()=>Qm,FeedbackScoreAveragePublic:()=>nr,FeedbackScoreBatch:()=>ii,FeedbackScoreBatchItem:()=>Xm,FeedbackScoreBatchItemSource:()=>Ym,FeedbackScoreBatchItemThread:()=>gp,FeedbackScoreBatchItemThreadSource:()=>hp,FeedbackScoreBatchThread:()=>mo,FeedbackScoreCompare:()=>im,FeedbackScoreCompareSource:()=>rm,FeedbackScoreExperimentItemBulkWriteView:()=>$s,FeedbackScoreExperimentItemBulkWriteViewSource:()=>Js,FeedbackScoreNames:()=>Om,FeedbackScorePublic:()=>Jr,FeedbackScorePublicSource:()=>qm,FeedbackScoreSource:()=>qs,FeedbackUpdate:()=>ad,FindFeedbackDefinitionsRequestType:()=>da,FindFeedbackScoreNames1RequestType:()=>ja,Function:()=>ut,FunctionCall:()=>De,GetSpanStatsRequestType:()=>Ea,GetSpansByProjectRequestType:()=>Ca,GetWebhookExamplesRequestAlertType:()=>Yi,GroupContent:()=>zm,GroupContentWithAggregations:()=>wm,GroupDetail:()=>km,GroupDetails:()=>Sm,Guardrail:()=>pd,GuardrailBatch:()=>Qx,GuardrailBatchWrite:()=>Jt,GuardrailName:()=>nd,GuardrailResult:()=>sd,GuardrailWrite:()=>ap,GuardrailWriteName:()=>op,GuardrailWriteResult:()=>ip,GuardrailsValidation:()=>Tm,GuardrailsValidationPublic:()=>cd,IdsHolder:()=>Yx,ImageUrl:()=>ec,ImageUrlPublic:()=>fc,ImageUrlWrite:()=>Rc,JsonListString:()=>K,JsonListStringCompare:()=>Ma,JsonListStringExperimentItemBulkWriteView:()=>Ae,JsonListStringPublic:()=>ye,JsonListStringWrite:()=>ge,JsonNode:()=>B,JsonNodeDetail:()=>cp,JsonNodePublic:()=>pe,JsonNodeWrite:()=>he,JsonSchema:()=>js,LlmAsJudgeCode:()=>Ao,LlmAsJudgeCodePublic:()=>xc,LlmAsJudgeCodeWrite:()=>Sc,LlmAsJudgeMessage:()=>sr,LlmAsJudgeMessageContent:()=>tc,LlmAsJudgeMessageContentPublic:()=>gc,LlmAsJudgeMessageContentWrite:()=>_c,LlmAsJudgeMessagePublic:()=>lr,LlmAsJudgeMessagePublicRole:()=>yc,LlmAsJudgeMessageRole:()=>oc,LlmAsJudgeMessageWrite:()=>ur,LlmAsJudgeMessageWriteRole:()=>zc,LlmAsJudgeModelParameters:()=>pr,LlmAsJudgeModelParametersPublic:()=>mr,LlmAsJudgeModelParametersWrite:()=>fr,LlmAsJudgeOutputSchema:()=>cr,LlmAsJudgeOutputSchemaPublic:()=>dr,LlmAsJudgeOutputSchemaPublicType:()=>bc,LlmAsJudgeOutputSchemaType:()=>ic,LlmAsJudgeOutputSchemaWrite:()=>hr,LlmAsJudgeOutputSchemaWriteType:()=>kc,LogItem:()=>md,LogItemLevel:()=>ld,LogPage:()=>dd,ManualEvaluationRequest:()=>ai,ManualEvaluationRequestEntityType:()=>ud,ManualEvaluationResponse:()=>ni,Message:()=>vs,MultipartUploadPart:()=>Jl,NumericalFeedbackDefinition:()=>Fm,NumericalFeedbackDefinitionCreate:()=>Wm,NumericalFeedbackDefinitionPublic:()=>oi,NumericalFeedbackDefinitionUpdate:()=>od,NumericalFeedbackDetail:()=>Um,NumericalFeedbackDetailCreate:()=>Mm,NumericalFeedbackDetailPublic:()=>Lm,NumericalFeedbackDetailUpdate:()=>td,Optimization:()=>Xx,OptimizationPagePublic:()=>jd,OptimizationPublic:()=>si,OptimizationPublicStatus:()=>_d,OptimizationStatus:()=>fd,OptimizationStudioConfig:()=>wd,OptimizationStudioConfigPublic:()=>vd,OptimizationStudioConfigWrite:()=>Nd,OptimizationStudioLog:()=>Md,OptimizationUpdate:()=>$t,OptimizationUpdateStatus:()=>ya,OptimizationWrite:()=>Va,OptimizationWriteStatus:()=>Wd,PageColumns:()=>Bd,PercentageValueStatPublic:()=>Vd,PercentageValues:()=>Me,PercentageValuesDetailed:()=>Ld,PercentageValuesPublic:()=>ri,Project:()=>Zx,ProjectDetailed:()=>Gd,ProjectDetailedVisibility:()=>Jd,ProjectMetricRequestPublic:()=>Qt,ProjectMetricRequestPublicInterval:()=>xa,ProjectMetricRequestPublicMetricType:()=>Ra,ProjectMetricResponsePublic:()=>Yd,ProjectMetricResponsePublicInterval:()=>Kd,ProjectMetricResponsePublicMetricType:()=>$d,ProjectPagePublic:()=>Zd,ProjectPublic:()=>pi,ProjectPublicVisibility:()=>Xd,ProjectReference:()=>uc,ProjectReferencePublic:()=>Bo,ProjectRetrieveDetailed:()=>Yt,ProjectStatItemObjectPublic:()=>qd,ProjectStatsPublic:()=>Je,ProjectStatsSummary:()=>ru,ProjectStatsSummaryItem:()=>eu,ProjectUpdate:()=>Xt,ProjectUpdateVisibility:()=>wa,ProjectVisibility:()=>Hd,ProjectWrite:()=>Zt,ProjectWriteVisibility:()=>_a,Prompt:()=>Ox,PromptDetail:()=>pu,PromptDetailTemplateStructure:()=>su,PromptPagePublic:()=>mu,PromptPublic:()=>lu,PromptPublicTemplateStructure:()=>cu,PromptTemplateStructure:()=>tu,PromptTokensDetails:()=>Sl,PromptType:()=>ou,PromptUpdatable:()=>qt,PromptVersion:()=>nu,PromptVersionBatchUpdate:()=>eo,PromptVersionDetail:()=>Ee,PromptVersionDetailTemplateStructure:()=>lp,PromptVersionDetailType:()=>mp,PromptVersionLink:()=>Wa,PromptVersionLinkPublic:()=>Ba,PromptVersionLinkWrite:()=>pa,PromptVersionPagePublic:()=>hu,PromptVersionPublic:()=>fu,PromptVersionPublicTemplateStructure:()=>du,PromptVersionPublicType:()=>uu,PromptVersionRetrieveDetail:()=>ro,PromptVersionTemplateStructure:()=>iu,PromptVersionType:()=>au,PromptVersionUpdate:()=>dp,PromptWrite:()=>to,PromptWriteTemplateStructure:()=>Sa,PromptWriteType:()=>Pa,ProviderApiKey:()=>qx,ProviderApiKeyPagePublic:()=>bu,ProviderApiKeyProvider:()=>gu,ProviderApiKeyPublic:()=>ci,ProviderApiKeyPublicProvider:()=>yu,ProviderApiKeyUpdate:()=>Gt,ProviderApiKeyWrite:()=>Kt,ProviderApiKeyWriteProvider:()=>ha,ResponseFormat:()=>Cs,ResponseFormatType:()=>Es,Result:()=>xr,ResultsNumberPublic:()=>Qd,ScoreName:()=>Zm,ServiceTogglesConfig:()=>xu,Span:()=>qo,SpanBatch:()=>eR,SpanBatchUpdate:()=>io,SpanBatchWrite:()=>so,SpanEnrichmentOptions:()=>Fs,SpanExperimentItemBulkWriteView:()=>Ys,SpanExperimentItemBulkWriteViewType:()=>Qs,SpanFilter:()=>Be,SpanFilterOperator:()=>sc,SpanFilterPublic:()=>Ue,SpanFilterPublicOperator:()=>np,SpanFilterWrite:()=>Vo,SpanFilterWriteOperator:()=>Mc,SpanLlmAsJudgeCode:()=>To,SpanLlmAsJudgeCodePublic:()=>vc,SpanLlmAsJudgeCodeWrite:()=>Wc,SpanPagePublic:()=>wu,SpanPublic:()=>li,SpanPublicType:()=>Ru,SpanSearchStreamRequestPublic:()=>po,SpanSearchStreamRequestPublicType:()=>Ta,SpanType:()=>Am,SpanUpdate:()=>oo,SpanUpdateType:()=>up,SpanUserDefinedMetricPythonCode:()=>vo,SpanUserDefinedMetricPythonCodePublic:()=>jc,SpanUserDefinedMetricPythonCodeWrite:()=>Vc,SpanWrite:()=>no,SpanWriteType:()=>fp,SpansCountResponse:()=>zu,StartMultipartUploadRequest:()=>dt,StartMultipartUploadRequestEntityType:()=>Oi,StartMultipartUploadResponse:()=>ku,StreamOptions:()=>Is,StudioEvaluation:()=>gd,StudioEvaluationPublic:()=>kd,StudioEvaluationWrite:()=>Cd,StudioLlmModel:()=>yd,StudioLlmModelPublic:()=>Sd,StudioLlmModelWrite:()=>Id,StudioMessage:()=>xd,StudioMessagePublic:()=>Ad,StudioMessageWrite:()=>Ud,StudioMetric:()=>hd,StudioMetricPublic:()=>zd,StudioMetricWrite:()=>Ed,StudioOptimizer:()=>bd,StudioOptimizerPublic:()=>Pd,StudioOptimizerWrite:()=>Dd,StudioPrompt:()=>Rd,StudioPromptPublic:()=>Td,StudioPromptWrite:()=>Fd,Tool:()=>Us,ToolCall:()=>Po,ToolCallType:()=>Gp,ToolType:()=>Ds,Trace:()=>ei,TraceBatch:()=>rR,TraceBatchUpdate:()=>fo,TraceBatchWrite:()=>go,TraceCountResponse:()=>Pu,TraceEnrichmentOptions:()=>Ns,TraceExperimentItemBulkWriteView:()=>Xs,TraceFilter:()=>We,TraceFilterOperator:()=>ac,TraceFilterPublic:()=>Fe,TraceFilterPublicOperator:()=>sp,TraceFilterWrite:()=>Do,TraceFilterWriteOperator:()=>Pc,TracePagePublic:()=>Tu,TracePublic:()=>mi,TracePublicVisibilityMode:()=>Au,TraceSearchStreamRequestPublic:()=>yo,TraceThread:()=>di,TraceThreadBatchIdentifier:()=>bo,TraceThreadBatchUpdate:()=>Ro,TraceThreadFilter:()=>Te,TraceThreadFilterOperator:()=>yp,TraceThreadFilterPublic:()=>ir,TraceThreadFilterPublicOperator:()=>pp,TraceThreadFilterWrite:()=>Lo,TraceThreadFilterWriteOperator:()=>Hc,TraceThreadIdentifier:()=>La,TraceThreadLlmAsJudgeCode:()=>jo,TraceThreadLlmAsJudgeCodePublic:()=>Ec,TraceThreadLlmAsJudgeCodeWrite:()=>Jc,TraceThreadPage:()=>ju,TraceThreadSearchStreamRequest:()=>wo,TraceThreadStatus:()=>vu,TraceThreadUpdate:()=>xo,TraceThreadUserDefinedMetricPythonCode:()=>Eo,TraceThreadUserDefinedMetricPythonCodePublic:()=>Cc,TraceThreadUserDefinedMetricPythonCodeWrite:()=>Kc,TraceUpdate:()=>uo,TraceVisibilityMode:()=>vm,TraceWrite:()=>ho,UploadAttachmentRequestEntityType:()=>ta,Usage:()=>Pl,UserDefinedMetricPythonCode:()=>Co,UserDefinedMetricPythonCodePublic:()=>Ic,UserDefinedMetricPythonCodeWrite:()=>tl,ValueEntry:()=>rp,ValueEntryCompare:()=>om,ValueEntryCompareSource:()=>tm,ValueEntryExperimentItemBulkWriteView:()=>Ks,ValueEntryExperimentItemBulkWriteViewSource:()=>Gs,ValueEntryPublic:()=>rd,ValueEntryPublicSource:()=>ed,ValueEntrySource:()=>ep,VideoUrl:()=>rc,VideoUrlPublic:()=>hc,VideoUrlWrite:()=>wc,Webhook:()=>kp,WebhookExamples:()=>Eu,WebhookPublic:()=>jp,WebhookTestResult:()=>Iu,WebhookTestResultStatus:()=>Cu,WebhookWrite:()=>Np,WelcomeWizardSubmission:()=>_o,WelcomeWizardTracking:()=>Du,WorkspaceConfiguration:()=>ui,WorkspaceMetricRequest:()=>tR,WorkspaceMetricResponse:()=>Ha,WorkspaceMetricsSummaryRequest:()=>Gr,WorkspaceMetricsSummaryResponse:()=>Uu,WorkspaceNameHolder:()=>Fu,WorkspaceSpansCount:()=>_u,WorkspaceTraceCount:()=>Su,alerts:()=>Xi,annotationQueues:()=>Zi,attachments:()=>Er,chatCompletions:()=>oa,dashboards:()=>ia,datasets:()=>Ir,experiments:()=>Dr,feedbackDefinitions:()=>ua,guardrails:()=>fa,llmProviderKey:()=>ga,optimizations:()=>ba,projects:()=>za,prompts:()=>Aa,spans:()=>Ur,traces:()=>ar,welcomeWizard:()=>Ua});var Xi={};W(Xi,{GetWebhookExamplesRequestAlertType:()=>Yi});var Yi=r.enum_(["general","slack","pagerduty"]);var Ts=r.enum_(["trace","thread"]);var ct=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:Ts,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional())});var lt=r.object({annotationQueues:r.property("annotation_queues",r.list(ct))});var mt=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 Zi={};W(Zi,{AnnotationQueueBatchWrite:()=>lt,AnnotationQueueUpdate:()=>mt});var Oi=r.enum_(["trace","span"]);var dt=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",Oi),entityId:r.property("entity_id",r.string()),path:r.string()});var Er={};W(Er,{AttachmentListRequestEntityType:()=>ea,DownloadAttachmentRequestEntityType:()=>ra,StartMultipartUploadRequest:()=>dt,StartMultipartUploadRequestEntityType:()=>Oi,UploadAttachmentRequestEntityType:()=>ta,uploadAttachment:()=>qi});var qi={};W(qi,{Request:()=>kx});var kx=r.record(r.string(),r.unknown());var ea=r.enum_(["trace","span"]);var ra=r.enum_(["trace","span"]);var ta=r.enum_(["trace","span"]);var ut=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 De=r.object({name:r.string().optional(),arguments:r.string().optional()});var vs=r.record(r.string(),r.unknown());var js=r.object({name:r.string().optional(),strict:r.boolean().optional(),schema:r.record(r.string(),r.record(r.string(),r.unknown())).optional()});var Es=r.enum_(["text","json_object","json_schema"]);var Cs=r.object({type:Es.optional(),jsonSchema:r.property("json_schema",js.optional())});var Is=r.object({includeUsage:r.property("include_usage",r.boolean().optional())});var Ds=r.enum_(["function"]);var Us=r.object({type:Ds.optional(),function:ut.optional()});var ft=r.object({model:r.string().optional(),messages:r.list(vs).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",Is.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(Us).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(ut).optional(),functionCall:r.property("function_call",De.optional())});var oa={};W(oa,{ChatCompletionRequest:()=>ft});var pe=r.record(r.string(),r.unknown());var ht=r.object({name:r.string().optional(),description:r.string().optional(),config:pe.optional()});var he=r.record(r.string(),r.unknown());var gt=r.object({name:r.string(),description:r.string().optional(),config:he});var ia={};W(ia,{DashboardUpdatePublic:()=>ht,DashboardWrite:()=>gt});var Fs=r.object({includeTags:r.boolean().optional(),includeFeedbackScores:r.boolean().optional(),includeComments:r.boolean().optional(),includeUsage:r.boolean().optional(),includeMetadata:r.boolean().optional()});var yt=r.object({spanIds:r.property("span_ids",r.list(r.string())),enrichmentOptions:r.property("enrichment_options",Fs)});var Ns=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 bt=r.object({traceIds:r.property("trace_ids",r.list(r.string())),enrichmentOptions:r.property("enrichment_options",Ns)});var xt=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 Rt=r.object({datasetName:r.property("dataset_name",r.string())});var wt=r.object({datasetName:r.property("dataset_name",r.string())});var Ms=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var _t=r.object({field:r.string().optional(),operator:Ms.optional(),key:r.string().optional(),value:r.string().optional()});var B=r.record(r.string(),r.unknown());var Ws=r.object({input:r.string().optional(),expectedOutput:r.property("expected_output",r.string().optional()),metadata:B.optional(),data:B.optional(),tags:r.list(r.string()).optional()});var zt=r.object({ids:r.list(r.string()).optional(),filters:r.list(_t).optional(),datasetId:r.property("dataset_id",r.string().optional()),update:Ws,mergeTags:r.property("merge_tags",r.boolean().optional())});var Bs=r.enum_(["manual","trace","span","sdk"]);var kt=r.object({id:r.string().optional(),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Bs,data:B,tags:r.list(r.string()).optional()});var St=r.object({datasetName:r.property("dataset_name",r.string().optional()),datasetId:r.property("dataset_id",r.string().optional()),items:r.list(kt),batchGroupId:r.property("batch_group_id",r.string().optional())});var Pt=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()),datasetVersion:r.property("dataset_version",r.string().optional())});var At=r.object({itemIds:r.property("item_ids",r.list(r.string()).optional()),datasetId:r.property("dataset_id",r.string().optional()),filters:r.list(_t).optional(),batchGroupId:r.property("batch_group_id",r.string().optional())});var aa=r.enum_(["private","public"]);var Tt=r.object({name:r.string(),description:r.string().optional(),visibility:aa.optional(),tags:r.list(r.string()).optional()});var vt=r.object({versionRef:r.property("version_ref",r.string())});var jt=r.object({tag:r.string()});var Et=r.object({changeDescription:r.property("change_description",r.string().optional()),tagsToAdd:r.property("tags_to_add",r.list(r.string()).optional())});var na=r.enum_(["private","public"]);var Ct=r.object({id:r.string().optional(),name:r.string(),visibility:na.optional(),tags:r.list(r.string()).optional(),description:r.string().optional()});var Ir={};W(Ir,{CreateDatasetItemsFromSpansRequest:()=>yt,CreateDatasetItemsFromTracesRequest:()=>bt,DatasetExpansionWrite:()=>xt,DatasetIdentifier:()=>Rt,DatasetIdentifierPublic:()=>wt,DatasetItemBatchUpdate:()=>zt,DatasetItemBatchWrite:()=>St,DatasetItemStreamRequest:()=>Pt,DatasetItemsDelete:()=>At,DatasetUpdate:()=>Tt,DatasetUpdateVisibility:()=>aa,DatasetVersionRestorePublic:()=>vt,DatasetVersionTag:()=>jt,DatasetVersionUpdatePublic:()=>Et,DatasetWrite:()=>Ct,DatasetWriteVisibility:()=>na,getDatasetExportJobs:()=>sa});var sa={};W(sa,{Response:()=>Sx});var Vs=r.enum_(["PENDING","PROCESSING","COMPLETED","FAILED"]);var Cr=r.object({id:r.string().optional(),datasetId:r.property("dataset_id",r.string().optional()),datasetName:r.property("dataset_name",r.string().optional()),status:Vs.optional(),filePath:r.property("file_path",r.string().optional()),errorMessage:r.property("error_message",r.string().optional()),createdAt:r.property("created_at",r.date().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),expiresAt:r.property("expires_at",r.date().optional()),viewedAt:r.property("viewed_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Sx=r.list(Cr);var It=r.object({name:r.string(),value:r.number()});var Ls=r.enum_(["running","completed","cancelled"]);var Hs=r.enum_(["regular","trial","mini-batch"]);var Dt=r.object({name:r.string().optional(),metadata:B.optional(),tags:r.list(r.string()).optional(),type:Hs.optional(),status:Ls.optional(),experimentScores:r.property("experiment_scores",r.list(It).optional())});var Ut=r.object({ids:r.list(r.string()),update:Dt,mergeTags:r.property("merge_tags",r.boolean().optional())});var Js=r.enum_(["ui","sdk","online_scoring"]);var Gs=r.enum_(["ui","sdk","online_scoring"]);var Ks=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:Gs.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),spanType:r.property("span_type",r.string().optional()),spanId:r.property("span_id",r.string().optional())});var $s=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:Js,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(),Ks).optional())});var Ae=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Ft=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var Qs=r.enum_(["general","tool","llm","guardrail"]);var Ys=r.object({id:r.string().optional(),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:Qs.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:Ae.optional(),output:Ae.optional(),metadata:Ae.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",Ft.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 Xs=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:Ae.optional(),output:Ae.optional(),metadata:Ae.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Ft.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),threadId:r.property("thread_id",r.string().optional())});var Zs=r.object({datasetItemId:r.property("dataset_item_id",r.string()),evaluateTaskResult:r.property("evaluate_task_result",Ae.optional()),trace:Xs.optional(),spans:r.list(Ys).optional(),feedbackScores:r.property("feedback_scores",r.list($s).optional())});var Nt=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(Zs)});var Mt=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 O=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 Os=r.enum_(["default","hidden"]);var qs=r.enum_(["ui","sdk","online_scoring"]);var ep=r.enum_(["ui","sdk","online_scoring"]);var rp=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:ep.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),spanType:r.property("span_type",r.string().optional()),spanId:r.property("span_id",r.string().optional())});var se=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:qs,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(),rp).optional())});var K=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Wt=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:K.optional(),output:K.optional(),feedbackScores:r.property("feedback_scores",r.list(se).optional()),comments:r.list(O).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",Os.optional())});var Bt=r.object({experimentItems:r.property("experiment_items",r.list(Wt))});var Vt=r.object({ids:r.list(r.string())});var Lt=r.object({name:r.string(),limit:r.number().optional(),lastRetrievedId:r.property("last_retrieved_id",r.string().optional())});var tp=r.object({name:r.string(),value:r.number()});var ge=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var pa=r.object({id:r.string()});var ca=r.enum_(["running","completed","cancelled"]);var la=r.enum_(["regular","trial","mini-batch"]);var Ht=r.object({id:r.string().optional(),datasetName:r.property("dataset_name",r.string()),name:r.string().optional(),metadata:ge.optional(),tags:r.list(r.string()).optional(),type:la.optional(),optimizationId:r.property("optimization_id",r.string().optional()),status:ca.optional(),experimentScores:r.property("experiment_scores",r.list(tp).optional()),promptVersion:r.property("prompt_version",pa.optional()),promptVersions:r.property("prompt_versions",r.list(pa).optional()),datasetVersionId:r.property("dataset_version_id",r.string().optional())});var Dr={};W(Dr,{ExperimentBatchUpdate:()=>Ut,ExperimentItemBulkUploadExperimentItemBulkWriteView:()=>Nt,ExperimentItemStreamRequest:()=>Mt,ExperimentItemsBatch:()=>Bt,ExperimentItemsDelete:()=>Vt,ExperimentStreamRequestPublic:()=>Lt,ExperimentWrite:()=>Ht,ExperimentWriteStatus:()=>ca,ExperimentWriteType:()=>la,findFeedbackScoreNames:()=>ma});var ma={};W(ma,{Response:()=>Px});var Px=r.list(r.string());var ua={};W(ua,{FindFeedbackDefinitionsRequestType:()=>da});var da=r.enum_(["numerical","categorical","boolean"]);var op=r.enum_(["TOPIC","PII"]);var ip=r.enum_(["passed","failed"]);var ap=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:op,result:ip,config:B,details:B});var Jt=r.object({guardrails:r.list(ap)});var fa={};W(fa,{GuardrailBatchWrite:()=>Jt});var Gt=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 ha=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","bedrock","custom-llm","opik-free"]);var Kt=r.object({provider:ha,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 ga={};W(ga,{ProviderApiKeyUpdate:()=>Gt,ProviderApiKeyWrite:()=>Kt,ProviderApiKeyWriteProvider:()=>ha});var ya=r.enum_(["running","completed","cancelled","initialized","error"]);var $t=r.object({name:r.string().optional(),status:ya.optional()});var ba={};W(ba,{OptimizationUpdate:()=>$t,OptimizationUpdateStatus:()=>ya});var np=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Ue=r.object({field:r.string().optional(),operator:np.optional(),key:r.string().optional(),value:r.string().optional()});var sp=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Fe=r.object({field:r.string().optional(),operator:sp.optional(),key:r.string().optional(),value:r.string().optional()});var pp=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var ir=r.object({field:r.string().optional(),operator:pp.optional(),key:r.string().optional(),value:r.string().optional()});var xa=r.enum_(["HOURLY","DAILY","WEEKLY"]);var Ra=r.enum_(["FEEDBACK_SCORES","TRACE_COUNT","TOKEN_USAGE","DURATION","COST","GUARDRAILS_FAILED_COUNT","THREAD_COUNT","THREAD_DURATION","THREAD_FEEDBACK_SCORES","SPAN_FEEDBACK_SCORES","SPAN_COUNT","SPAN_DURATION","SPAN_TOKEN_USAGE"]);var Qt=r.object({metricType:r.property("metric_type",Ra.optional()),interval:xa.optional(),intervalStart:r.property("interval_start",r.date().optional()),intervalEnd:r.property("interval_end",r.date().optional()),spanFilters:r.property("span_filters",r.list(Ue).optional()),traceFilters:r.property("trace_filters",r.list(Fe).optional()),threadFilters:r.property("thread_filters",r.list(ir).optional())});var Yt=r.object({name:r.string()});var wa=r.enum_(["private","public"]);var Xt=r.object({name:r.string().optional(),description:r.string().optional(),visibility:wa.optional()});var _a=r.enum_(["private","public"]);var Zt=r.object({name:r.string(),visibility:_a.optional(),description:r.string().optional()});var za={};W(za,{ProjectMetricRequestPublic:()=>Qt,ProjectMetricRequestPublicInterval:()=>xa,ProjectMetricRequestPublicMetricType:()=>Ra,ProjectRetrieveDetailed:()=>Yt,ProjectUpdate:()=>Xt,ProjectUpdateVisibility:()=>wa,ProjectWrite:()=>Zt,ProjectWriteVisibility:()=>_a});var cp=r.record(r.string(),r.unknown());var lp=r.enum_(["text","chat"]);var mp=r.enum_(["mustache","jinja2"]);var Ee=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:cp.optional(),type:mp.optional(),changeDescription:r.property("change_description",r.string().optional()),tags:r.list(r.string()).optional(),variables:r.list(r.string()).optional(),templateStructure:r.property("template_structure",lp.optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var ka=r.enum_(["text","chat"]);var Ot=r.object({name:r.string(),version:Ee,templateStructure:r.property("template_structure",ka.optional())});var qt=r.object({name:r.string(),description:r.string().optional(),tags:r.list(r.string()).optional()});var dp=r.object({tags:r.list(r.string()).optional()});var eo=r.object({ids:r.list(r.string()),update:dp,mergeTags:r.property("merge_tags",r.boolean().optional())});var ro=r.object({name:r.string(),commit:r.string().optional()});var Sa=r.enum_(["text","chat"]);var Pa=r.enum_(["mustache","jinja2"]);var to=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),template:r.string().optional(),metadata:he.optional(),changeDescription:r.property("change_description",r.string().optional()),type:Pa.optional(),templateStructure:r.property("template_structure",Sa.optional()),tags:r.list(r.string()).optional()});var Aa={};W(Aa,{CreatePromptVersionDetail:()=>Ot,CreatePromptVersionDetailTemplateStructure:()=>ka,PromptUpdatable:()=>qt,PromptVersionBatchUpdate:()=>eo,PromptVersionRetrieveDetail:()=>ro,PromptWrite:()=>to,PromptWriteTemplateStructure:()=>Sa,PromptWriteType:()=>Pa});var Ne=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var up=r.enum_(["general","tool","llm","guardrail"]);var oo=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:up.optional(),endTime:r.property("end_time",r.date().optional()),input:K.optional(),output:K.optional(),metadata:K.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",Ne.optional())});var io=r.object({ids:r.list(r.string()),update:oo,mergeTags:r.property("merge_tags",r.boolean().optional())});var ao=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var fp=r.enum_(["general","tool","llm","guardrail"]);var no=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:fp.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:ge.optional(),output:ge.optional(),metadata:ge.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",ao.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 so=r.object({spans:r.list(no)});var Ta=r.enum_(["general","tool","llm","guardrail"]);var po=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:Ta.optional(),filters:r.list(Ue).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 Ur={};W(Ur,{FindFeedbackScoreNames1RequestType:()=>ja,GetSpanStatsRequestType:()=>Ea,GetSpansByProjectRequestType:()=>Ca,SpanBatchUpdate:()=>io,SpanBatchWrite:()=>so,SpanSearchStreamRequestPublic:()=>po,SpanSearchStreamRequestPublicType:()=>Ta,findFeedbackScoreNames1:()=>va});var va={};W(va,{Response:()=>Ax});var Ax=r.list(r.string());var ja=r.enum_(["general","tool","llm","guardrail"]);var Ea=r.enum_(["general","tool","llm","guardrail"]);var Ca=r.enum_(["general","tool","llm","guardrail"]);var co=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 lo=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 hp=r.enum_(["ui","sdk","online_scoring"]);var gp=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:hp,author:r.string().optional(),threadId:r.property("thread_id",r.string())});var mo=r.object({scores:r.list(gp)});var uo=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:K.optional(),output:K.optional(),metadata:K.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Ne.optional()),threadId:r.property("thread_id",r.string().optional())});var fo=r.object({ids:r.list(r.string()),update:uo,mergeTags:r.property("merge_tags",r.boolean().optional())});var ho=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:ge.optional(),output:ge.optional(),metadata:ge.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",ao.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),threadId:r.property("thread_id",r.string().optional())});var go=r.object({traces:r.list(ho)});var yo=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),filters:r.list(Fe).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 bo=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 xo=r.object({tags:r.list(r.string()).optional()});var Ro=r.object({ids:r.list(r.string()),update:xo,mergeTags:r.property("merge_tags",r.boolean().optional())});var yp=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Te=r.object({field:r.string().optional(),operator:yp.optional(),key:r.string().optional(),value:r.string().optional()});var wo=r.object({projectName:r.property("project_name",r.string().optional()),projectId:r.property("project_id",r.string().optional()),filters:r.list(Te).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 ar={};W(ar,{DeleteThreadFeedbackScores:()=>co,DeleteTraceThreads:()=>lo,FeedbackScoreBatchThread:()=>mo,TraceBatchUpdate:()=>fo,TraceBatchWrite:()=>go,TraceSearchStreamRequestPublic:()=>yo,TraceThreadBatchIdentifier:()=>bo,TraceThreadBatchUpdate:()=>Ro,TraceThreadSearchStreamRequest:()=>wo,findFeedbackScoreNames2:()=>Ia,findTraceThreadsFeedbackScoreNames:()=>Da});var Ia={};W(Ia,{Response:()=>Tx});var Tx=r.list(r.string());var Da={};W(Da,{Response:()=>vx});var vx=r.list(r.string());var _o=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 Ua={};W(Ua,{WelcomeWizardSubmission:()=>_o});var me=r.object({name:r.string(),value:r.number()});var Me=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var bp=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:Me.optional(),feedbackScores:r.property("feedback_scores",r.list(me).optional()),experimentScores:r.property("experiment_scores",r.list(me).optional())});var xp=r.enum_(["general","slack","pagerduty"]);var Rp=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var wp=r.object({id:r.string().optional(),alertTriggerId:r.property("alert_trigger_id",r.string().optional()),type:Rp,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 _p=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 zp=r.object({id:r.string().optional(),alertId:r.property("alert_id",r.string().optional()),eventType:r.property("event_type",_p),triggerConfigs:r.property("trigger_configs",r.list(wp).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var kp=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 jx=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",xp.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:kp,triggers:r.list(zp).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 Sp=r.enum_(["general","slack","pagerduty"]);var Pp=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var Ap=r.object({id:r.string().optional(),alertTriggerId:r.property("alert_trigger_id",r.string().optional()),type:Pp,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 Tp=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 vp=r.object({id:r.string().optional(),alertId:r.property("alert_id",r.string().optional()),eventType:r.property("event_type",Tp),triggerConfigs:r.property("trigger_configs",r.list(Ap).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var jp=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 zo=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",Sp.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:jp,triggers:r.list(vp).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 Ep=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(zo).optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var Cp=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var Ip=r.object({id:r.string().optional(),type:Cp,configValue:r.property("config_value",r.record(r.string(),r.string()).optional())});var Dp=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 Up=r.object({id:r.string().optional(),eventType:r.property("event_type",Dp),triggerConfigs:r.property("trigger_configs",r.list(Ip).optional())});var Fp=r.enum_(["general","slack","pagerduty"]);var Np=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 ko=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",Fp.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:Np,triggers:r.list(Up).optional()});var Mp=r.object({username:r.string().optional(),status:r.number().optional()});var Wp=r.enum_(["trace","thread"]);var Bp=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:Wp,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional()),reviewers:r.list(Mp).optional(),feedbackScores:r.property("feedback_scores",r.list(me).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 Ex=r.object({annotationQueues:r.property("annotation_queues",r.list(Bp))});var Fa=r.object({ids:r.list(r.string())});var Vp=r.enum_(["trace","thread"]);var Lp=r.object({username:r.string().optional(),status:r.number().optional()});var nr=r.object({name:r.string(),value:r.number()});var So=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:Vp,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(nr).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 Hp=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(So).optional(),sortableBy:r.list(r.string()).optional()});var Jp=r.enum_(["system","user","assistant","tool","function"]);var Gp=r.enum_(["function"]);var Po=r.object({id:r.string().optional(),index:r.number().optional(),type:Gp.optional(),function:De.optional()});var Kp=r.object({role:Jp.optional(),content:r.string().optional(),reasoningContent:r.property("reasoning_content",r.string().optional()),name:r.string().optional(),toolCalls:r.property("tool_calls",r.list(Po).optional()),refusal:r.string().optional(),functionCall:r.property("function_call",De.optional())});var $p=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 Qp=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list($p).optional(),sortableBy:r.list(r.string()).optional()});var Yp=r.object({url:r.string()});var Xp=r.object({url:r.string()});var Zp=r.object({url:r.string()});var Op=r.record(r.string(),r.unknown());var qp=r.enum_(["evaluator"]);var ec=r.object({url:r.string(),detail:r.string().optional()});var rc=r.object({url:r.string()});var tc=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",ec.optional()),videoUrl:r.property("video_url",rc.optional()),audioUrl:r.property("audio_url",Yp.optional())});var oc=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var sr=r.object({role:oc,content:r.string().optional(),contentArray:r.property("content_array",r.list(tc).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var pr=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",B.optional())});var ic=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var cr=r.object({name:r.string(),type:ic,description:r.string()});var Ao=r.object({model:pr,messages:r.list(sr),variables:r.record(r.string(),r.string()),schema:r.list(cr)});var ac=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var We=r.object({field:r.string().optional(),operator:ac.optional(),key:r.string().optional(),value:r.string().optional()});var nc=r.object({filters:r.list(We).optional(),code:Ao.optional()});var sc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Be=r.object({field:r.string().optional(),operator:sc.optional(),key:r.string().optional(),value:r.string().optional()});var To=r.object({model:pr,messages:r.list(sr),variables:r.record(r.string(),r.string()),schema:r.list(cr)});var pc=r.object({filters:r.list(Be).optional(),code:To.optional()});var vo=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var cc=r.object({filters:r.list(Be).optional(),code:vo.optional()});var jo=r.object({model:pr,messages:r.list(sr),schema:r.list(cr)});var lc=r.object({filters:r.list(Te).optional(),code:jo.optional()});var Eo=r.object({metric:r.string()});var mc=r.object({filters:r.list(Te).optional(),code:Eo.optional()});var Co=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var dc=r.object({filters:r.list(We).optional(),code:Co.optional()});var uc=r.object({projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string())});var Fr=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string().optional()),projectName:r.property("project_name",r.string().optional()),projects:r.list(uc).optional(),projectIds:r.property("project_ids",r.list(r.string()).optional()),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().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:qp}),Cx=r.union("type",{llm_as_judge:nc.extend(Fr),user_defined_metric_python:dc.extend(Fr),trace_thread_llm_as_judge:lc.extend(Fr),trace_thread_user_defined_metric_python:mc.extend(Fr),span_llm_as_judge:pc.extend(Fr),span_user_defined_metric_python:cc.extend(Fr)}).transform({transform:n=>n,untransform:n=>n});var fc=r.object({url:r.string(),detail:r.string().optional()});var hc=r.object({url:r.string()});var gc=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",fc.optional()),videoUrl:r.property("video_url",hc.optional()),audioUrl:r.property("audio_url",Xp.optional())});var yc=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var lr=r.object({role:yc,content:r.string().optional(),contentArray:r.property("content_array",r.list(gc).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var mr=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",pe.optional())});var bc=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var dr=r.object({name:r.string(),type:bc,description:r.string()});var xc=r.object({model:mr,messages:r.list(lr),variables:r.record(r.string(),r.string()),schema:r.list(dr)});var Io=r.object({filters:r.list(Fe).optional(),code:xc.optional()});var Rc=r.object({url:r.string(),detail:r.string().optional()});var wc=r.object({url:r.string()});var _c=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",Rc.optional()),videoUrl:r.property("video_url",wc.optional()),audioUrl:r.property("audio_url",Zp.optional())});var zc=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var ur=r.object({role:zc,content:r.string().optional(),contentArray:r.property("content_array",r.list(_c).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var fr=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",he.optional())});var kc=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var hr=r.object({name:r.string(),type:kc,description:r.string()});var Sc=r.object({model:fr,messages:r.list(ur),variables:r.record(r.string(),r.string()),schema:r.list(hr)});var Pc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Do=r.object({field:r.string().optional(),operator:Pc.optional(),key:r.string().optional(),value:r.string().optional()});var Ac=r.object({filters:r.list(Do).optional(),code:Sc.optional()});var Tc=r.enum_(["evaluator"]);var vc=r.object({model:mr,messages:r.list(lr),variables:r.record(r.string(),r.string()),schema:r.list(dr)});var Uo=r.object({filters:r.list(Ue).optional(),code:vc.optional()});var jc=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Fo=r.object({filters:r.list(Ue).optional(),code:jc.optional()});var Ec=r.object({model:mr,messages:r.list(lr),schema:r.list(dr)});var No=r.object({filters:r.list(ir).optional(),code:Ec.optional()});var Cc=r.object({metric:r.string()});var Mo=r.object({filters:r.list(ir).optional(),code:Cc.optional()});var Ic=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Wo=r.object({filters:r.list(Fe).optional(),code:Ic.optional()});var Bo=r.object({projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string())});var Nr=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string().optional()),projectName:r.property("project_name",r.string().optional()),projects:r.list(Bo).optional(),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().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:Tc}),Dc=r.union("type",{llm_as_judge:Io.extend(Nr),user_defined_metric_python:Wo.extend(Nr),trace_thread_llm_as_judge:No.extend(Nr),trace_thread_user_defined_metric_python:Mo.extend(Nr),span_llm_as_judge:Uo.extend(Nr),span_user_defined_metric_python:Fo.extend(Nr)}).transform({transform:n=>n,untransform:n=>n});var Uc=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Dc).optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var Fc=r.enum_(["evaluator"]);var Mr=r.object({id:r.string().optional(),projectId:r.property("project_id",r.string().optional()),projectName:r.property("project_name",r.string().optional()),projects:r.list(Bo).optional(),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().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:Fc}),Nc=r.union("type",{llm_as_judge:Io.extend(Mr),user_defined_metric_python:Wo.extend(Mr),trace_thread_llm_as_judge:No.extend(Mr),trace_thread_user_defined_metric_python:Mo.extend(Mr),span_llm_as_judge:Uo.extend(Mr),span_user_defined_metric_python:Fo.extend(Mr)}).transform({transform:n=>n,untransform:n=>n});var Mc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Vo=r.object({field:r.string().optional(),operator:Mc.optional(),key:r.string().optional(),value:r.string().optional()});var Wc=r.object({model:fr,messages:r.list(ur),variables:r.record(r.string(),r.string()),schema:r.list(hr)});var Bc=r.object({filters:r.list(Vo).optional(),code:Wc.optional()});var Vc=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Lc=r.object({filters:r.list(Vo).optional(),code:Vc.optional()});var Hc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Lo=r.object({field:r.string().optional(),operator:Hc.optional(),key:r.string().optional(),value:r.string().optional()});var Jc=r.object({model:fr,messages:r.list(ur),schema:r.list(hr)});var Gc=r.object({filters:r.list(Lo).optional(),code:Jc.optional()});var Kc=r.object({metric:r.string()});var $c=r.object({filters:r.list(Lo).optional(),code:Kc.optional()});var Qc=r.enum_(["evaluator"]);var Yc=r.object({filters:r.list(We).optional(),code:Ao.optional()});var Xc=r.object({filters:r.list(Be).optional(),code:To.optional()});var Zc=r.object({filters:r.list(Be).optional(),code:vo.optional()});var Oc=r.object({filters:r.list(Te).optional(),code:jo.optional()});var qc=r.object({filters:r.list(Te).optional(),code:Eo.optional()});var el=r.object({filters:r.list(We).optional(),code:Co.optional()});var Wr=r.object({name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),projectId:r.property("project_id",r.string().optional()),projectIds:r.property("project_ids",r.list(r.string()).optional()),action:Qc}),rl=r.union("type",{llm_as_judge:Yc.extend(Wr),user_defined_metric_python:el.extend(Wr),trace_thread_llm_as_judge:Oc.extend(Wr),trace_thread_user_defined_metric_python:qc.extend(Wr),span_llm_as_judge:Xc.extend(Wr),span_user_defined_metric_python:Zc.extend(Wr)}).transform({transform:n=>n,untransform:n=>n});var tl=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var ol=r.object({filters:r.list(Do).optional(),code:tl.optional()});var il=r.enum_(["evaluator"]);var Br=r.object({projectId:r.property("project_id",r.string().optional()),projectIds:r.property("project_ids",r.list(r.string()).optional()),name:r.string(),samplingRate:r.property("sampling_rate",r.number().optional()),enabled:r.boolean().optional(),action:il}),al=r.union("type",{llm_as_judge:Ac.extend(Br),user_defined_metric_python:ol.extend(Br),trace_thread_llm_as_judge:Gc.extend(Br),trace_thread_user_defined_metric_python:$c.extend(Br),span_llm_as_judge:Bc.extend(Br),span_user_defined_metric_python:Lc.extend(Br)}).transform({transform:n=>n,untransform:n=>n});var nl=r.object({value:r.number().optional()});var Y=r.object({ids:r.list(r.string())});var Ix=r.object({ids:r.list(r.string()),projectId:r.property("project_id",r.string().optional())});var sl=r.object({workspaceId:r.property("workspace_id",r.string().optional()),user:r.string().optional(),count:r.number().optional()});var Vr=r.object({biInformation:r.property("bi_information",r.list(sl).optional())});var pl=r.object({trueLabel:r.string(),falseLabel:r.string()});var cl=r.object({details:pl.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 ll=r.object({trueLabel:r.string(),falseLabel:r.string()});var ml=r.object({details:ll.optional()});var dl=r.object({trueLabel:r.string(),falseLabel:r.string()});var Ho=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 ul=r.object({trueLabel:r.string(),falseLabel:r.string()});var fl=r.object({details:ul.optional()});var hl=r.object({categories:r.record(r.string(),r.number())});var gl=r.object({details:hl.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 yl=r.object({categories:r.record(r.string(),r.number())});var bl=r.object({details:yl.optional()});var xl=r.object({categories:r.record(r.string(),r.number())});var Jo=r.object({details:xl.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 Rl=r.object({categories:r.record(r.string(),r.number())});var wl=r.object({details:Rl.optional()});var _l=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(Po).optional()),functionCall:r.property("function_call",De.optional())});var zl=r.object({index:r.number().optional(),message:Kp.optional(),delta:_l.optional(),finishReason:r.property("finish_reason",r.string().optional())});var kl=r.object({reasoningTokens:r.property("reasoning_tokens",r.number().optional())});var Sl=r.object({cachedTokens:r.property("cached_tokens",r.number().optional())});var Pl=r.object({totalTokens:r.property("total_tokens",r.number().optional()),promptTokens:r.property("prompt_tokens",r.number().optional()),promptTokensDetails:r.property("prompt_tokens_details",Sl.optional()),completionTokens:r.property("completion_tokens",r.number().optional()),completionTokensDetails:r.property("completion_tokens_details",kl.optional())});var Al=r.object({id:r.string().optional(),created:r.number().optional(),model:r.string().optional(),choices:r.list(zl).optional(),usage:Pl.optional(),systemFingerprint:r.property("system_fingerprint",r.string().optional()),serviceTier:r.property("service_tier",r.string().optional())});var Tl=r.enum_(["TOPIC","PII"]);var vl=r.enum_(["passed","failed"]);var jl=r.object({name:Tl.optional(),result:vl.optional()});var El=r.enum_(["TOPIC","PII"]);var Cl=r.enum_(["passed","failed"]);var Il=r.object({name:El.optional(),result:Cl.optional()});var Dl=r.object({typeName:r.string().optional()});var Dx=r.object({type:Dl.optional(),closed:r.boolean().optional()});var Ul=r.object({typeName:r.string().optional()});var Ux=r.object({type:Ul.optional(),closed:r.boolean().optional()});var Fl=r.enum_(["string","number","object","boolean","array","null"]);var Nl=r.object({name:r.string().optional(),types:r.list(Fl).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var Ml=r.enum_(["string","number","object","boolean","array","null"]);var Wl=r.object({name:r.string().optional(),types:r.list(Ml).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var Bl=r.enum_(["string","number","object","boolean","array","null"]);var Vl=r.object({name:r.string().optional(),types:r.list(Bl).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var Ll=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 gr=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 Hl=r.enum_(["trace","span"]);var Jl=r.object({eTag:r.property("e_tag",r.string()),partNumber:r.property("part_number",r.number())});var Na=r.object({fileName:r.property("file_name",r.string()),projectName:r.property("project_name",r.string().optional()),entityType:r.property("entity_type",Hl),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(Jl))});var Gl=r.object({value:r.number().optional()});var yr=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:pe,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 Kl=r.object({content:r.list(yr).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var Fx=r.object({time:r.date(),value:r.number().optional()});var $l=r.object({time:r.date(),value:r.number().optional()});var Ql=r.enum_(["unknown","processing","completed","failed"]);var Go=r.object({id:r.string().optional(),versionHash:r.property("version_hash",r.string().optional()),versionName:r.property("version_name",r.string().optional()),changeDescription:r.property("change_description",r.string().optional()),tags:r.list(r.string()).optional()});var Yl=r.enum_(["private","public"]);var Nx=r.object({id:r.string().optional(),name:r.string(),visibility:Yl.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()),status:Ql.optional(),latestVersion:r.property("latest_version",Go.optional())});var Mx=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 Xl=r.enum_(["manual","trace","span","sdk"]);var Ko=r.object({id:r.string().optional(),datasetItemId:r.property("dataset_item_id",r.string().optional()),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Xl,data:B,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Wt).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 Zl=r.object({generatedSamples:r.property("generated_samples",r.list(Ko).optional()),model:r.string().optional(),totalGenerated:r.property("total_generated",r.number().optional()),generationTime:r.property("generation_time",r.date().optional())});var Wx=r.object({datasetName:r.property("dataset_name",r.string().optional()),datasetId:r.property("dataset_id",r.string().optional()),items:r.list(Ko),batchGroupId:r.property("batch_group_id",r.string().optional())});var Ol=r.record(r.string(),r.unknown());var ql=r.enum_(["manual","trace","span","sdk"]);var em=r.enum_(["default","hidden"]);var rm=r.enum_(["ui","sdk","online_scoring"]);var tm=r.enum_(["ui","sdk","online_scoring"]);var om=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:tm.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),spanType:r.property("span_type",r.string().optional()),spanId:r.property("span_id",r.string().optional())});var im=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:rm,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(),om).optional())});var Ma=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var am=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:Ma.optional(),output:Ma.optional(),feedbackScores:r.property("feedback_scores",r.list(im).optional()),comments:r.list(Ll).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",em.optional())});var nm=r.object({id:r.string().optional(),datasetItemId:r.property("dataset_item_id",r.string().optional()),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:ql,data:B,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(am).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 sm=r.object({content:r.list(nm).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),columns:r.list(Wl).optional(),sortableBy:r.list(r.string()).optional()});var pm=r.enum_(["manual","trace","span","sdk"]);var cm=r.enum_(["default","hidden"]);var $o=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",cm.optional())});var Qo=r.object({id:r.string().optional(),datasetItemId:r.property("dataset_item_id",r.string().optional()),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:pm,data:B,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list($o).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 lm=r.object({content:r.list(Qo).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),columns:r.list(Vl).optional(),sortableBy:r.list(r.string()).optional()});var mm=r.enum_(["unknown","processing","completed","failed"]);var dm=r.enum_(["private","public"]);var Yo=r.object({id:r.string().optional(),versionHash:r.property("version_hash",r.string().optional()),versionName:r.property("version_name",r.string().optional()),changeDescription:r.property("change_description",r.string().optional()),tags:r.list(r.string()).optional()});var Lr=r.object({id:r.string().optional(),name:r.string(),visibility:dm.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()),status:mm.optional(),latestVersion:r.property("latest_version",Yo.optional())});var um=r.object({content:r.list(Lr).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),sortableBy:r.list(r.string()).optional()});var fm=r.object({itemsAdded:r.number().optional(),itemsModified:r.number().optional(),itemsDeleted:r.number().optional(),itemsUnchanged:r.number().optional()});var hm=r.object({fromVersion:r.property("from_version",r.string().optional()),toVersion:r.property("to_version",r.string().optional()),statistics:fm.optional()});var br=r.object({id:r.string().optional(),datasetId:r.property("dataset_id",r.string().optional()),versionHash:r.property("version_hash",r.string().optional()),tags:r.list(r.string()).optional(),isLatest:r.property("is_latest",r.boolean().optional()),versionName:r.property("version_name",r.string().optional()),itemsTotal:r.property("items_total",r.number().optional()),itemsAdded:r.property("items_added",r.number().optional()),itemsModified:r.property("items_modified",r.number().optional()),itemsDeleted:r.property("items_deleted",r.number().optional()),changeDescription:r.property("change_description",r.string().optional()),metadata: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 gm=r.object({content:r.list(br).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional()});var ym=r.enum_(["trace","span"]);var Bx=r.object({fileNames:r.property("file_names",r.list(r.string())),entityType:r.property("entity_type",ym),entityId:r.property("entity_id",r.string()),containerId:r.property("container_id",r.string())});var Xo=r.object({name:r.string(),author:r.string().optional()});var Hr=r.object({ids:r.list(r.string())});var Zo=r.object({count:r.number().optional(),deviation:r.number().optional(),deviationPercentage:r.property("deviation_percentage",r.number().optional())});var bm=r.object({count:r.number().optional(),deviation:r.number().optional(),deviationPercentage:r.property("deviation_percentage",r.number().optional())});var Oo=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var de=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var Vx=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var Lx=r.object({errors:r.list(r.string()).optional()});var Hx=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var xm=r.enum_(["running","completed","cancelled"]);var Rm=r.enum_(["regular","trial","mini-batch"]);var Wa=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 Jx=r.object({id:r.string().optional(),datasetName:r.property("dataset_name",r.string()),datasetId:r.property("dataset_id",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:r.string().optional(),metadata:K.optional(),tags:r.list(r.string()).optional(),type:Rm.optional(),optimizationId:r.property("optimization_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(me).optional()),comments:r.list(O).optional(),traceCount:r.property("trace_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),duration:Me.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:xm.optional(),experimentScores:r.property("experiment_scores",r.list(It).optional()),promptVersion:r.property("prompt_version",Wa.optional()),promptVersions:r.property("prompt_versions",r.list(Wa).optional()),datasetVersionId:r.property("dataset_version_id",r.string().optional()),datasetVersionSummary:r.property("dataset_version_summary",Go.optional())});var wm=r.object({label:r.string().optional(),aggregations:bp.optional()});var _m=r.object({content:r.record(r.string(),wm).optional()});var zm=r.object({label:r.string().optional()});var km=r.object({groupSorting:r.property("group_sorting",r.list(r.string()).optional())});var Sm=r.object({groupsDetails:r.property("groups_details",r.list(km).optional())});var Pm=r.object({content:r.record(r.string(),zm).optional(),details:Sm.optional()});var Am=r.enum_(["general","tool","llm","guardrail"]);var qo=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:Am.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:K.optional(),output:K.optional(),metadata:K.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",Ne.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(se).optional()),comments:r.list(O).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 Tm=r.object({spanId:r.property("span_id",r.string().optional()),checks:r.list(jl).optional()});var vm=r.enum_(["default","hidden"]);var ei=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:K.optional(),output:K.optional(),metadata:K.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Ne.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(se).optional()),spanFeedbackScores:r.property("span_feedback_scores",r.list(se).optional()),comments:r.list(O).optional(),guardrailsValidations:r.property("guardrails_validations",r.list(Tm).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",vm.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 jm=r.object({datasetItemId:r.property("dataset_item_id",r.string()),evaluateTaskResult:r.property("evaluate_task_result",K.optional()),trace:ei.optional(),spans:r.list(qo).optional(),feedbackScores:r.property("feedback_scores",r.list(se).optional())});var Gx=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(jm)});var Em=r.enum_(["running","completed","cancelled"]);var Cm=r.enum_(["regular","trial","mini-batch"]);var Im=r.object({name:r.string(),value:r.number()});var ye=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var ri=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var Ba=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 ti=r.object({id:r.string().optional(),datasetName:r.property("dataset_name",r.string()),datasetId:r.property("dataset_id",r.string().optional()),projectId:r.property("project_id",r.string().optional()),name:r.string().optional(),metadata:ye.optional(),tags:r.list(r.string()).optional(),type:Cm.optional(),optimizationId:r.property("optimization_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(nr).optional()),comments:r.list(gr).optional(),traceCount:r.property("trace_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),duration:ri.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:Em.optional(),experimentScores:r.property("experiment_scores",r.list(Im).optional()),promptVersion:r.property("prompt_version",Ba.optional()),promptVersions:r.property("prompt_versions",r.list(Ba).optional()),datasetVersionId:r.property("dataset_version_id",r.string().optional()),datasetVersionSummary:r.property("dataset_version_summary",Yo.optional())});var Dm=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ti).optional(),sortableBy:r.list(r.string()).optional()});var Kx=B;var Um=r.object({max:r.number(),min:r.number()});var Fm=r.object({details:Um.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.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()}),$x=r.union("type",{numerical:Fm.extend(Nm),categorical:gl.extend(Nm),boolean:cl.extend(Nm)}).transform({transform:n=>n,untransform:n=>n});var Mm=r.object({max:r.number(),min:r.number()});var Wm=r.object({details:Mm.optional()});var Bm=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional()}),Vm=r.union("type",{numerical:Wm.extend(Bm),categorical:bl.extend(Bm),boolean:ml.extend(Bm)}).transform({transform:n=>n,untransform:n=>n});var Lm=r.object({max:r.number(),min:r.number()});var oi=r.object({details:Lm.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 Hm=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()}),Jm=r.union("type",{numerical:oi.extend(Hm),categorical:Jo.extend(Hm),boolean:Ho.extend(Hm)}).transform({transform:n=>n,untransform:n=>n});var Gm=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Jm).optional()});var Km=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()}),$m=r.union("type",{numerical:oi.extend(Km),categorical:Jo.extend(Km),boolean:Ho.extend(Km)}).transform({transform:n=>n,untransform:n=>n});var Qm=r.object({name:r.string(),value:r.number()});var Ym=r.enum_(["ui","sdk","online_scoring"]);var Xm=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:Ym,author:r.string().optional(),id:r.string()});var ii=r.object({scores:r.list(Xm)});var Zm=r.object({name:r.string().optional(),type:r.string().optional()});var Om=r.object({scores:r.list(Zm).optional()});var qm=r.enum_(["ui","sdk","online_scoring"]);var ed=r.enum_(["ui","sdk","online_scoring"]);var rd=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:ed.optional(),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),spanType:r.property("span_type",r.string().optional()),spanId:r.property("span_id",r.string().optional())});var Jr=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:qm,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(),rd).optional())});var td=r.object({max:r.number(),min:r.number()});var od=r.object({details:td.optional()});var id=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional()}),ad=r.union("type",{numerical:od.extend(id),categorical:wl.extend(id),boolean:fl.extend(id)}).transform({transform:n=>n,untransform:n=>n});var nd=r.enum_(["TOPIC","PII"]);var sd=r.enum_(["passed","failed"]);var pd=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:nd,result:sd,config:B,details:B});var Qx=r.object({guardrails:r.list(pd)});var cd=r.object({spanId:r.property("span_id",r.string().optional()),checks:r.list(Il).optional()});var Yx=r.object({ids:r.list(r.string())});var ld=r.enum_(["INFO","WARN","ERROR","DEBUG","TRACE"]);var md=r.object({timestamp:r.date().optional(),ruleId:r.property("rule_id",r.string().optional()),level:ld.optional(),message:r.string().optional(),markers:r.record(r.string(),r.string()).optional()});var dd=r.object({content:r.list(md).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional()});var ud=r.enum_(["trace","thread","span"]);var ai=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",ud)});var ni=r.object({entitiesQueued:r.property("entities_queued",r.number().optional()),rulesApplied:r.property("rules_applied",r.number().optional())});var fd=r.enum_(["running","completed","cancelled","initialized","error"]);var hd=r.object({type:r.string(),parameters:B.optional()});var gd=r.object({metrics:r.list(hd)});var yd=r.object({model:r.string(),parameters:B.optional()});var bd=r.object({type:r.string(),parameters:B.optional()});var xd=r.object({role:r.string(),content:r.string()});var Rd=r.object({messages:r.list(xd)});var wd=r.object({datasetName:r.property("dataset_name",r.string()),prompt:Rd,llmModel:r.property("llm_model",yd),evaluation:gd,optimizer:bd});var Xx=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:fd,metadata:K.optional(),studioConfig:r.property("studio_config",wd.optional()),datasetId:r.property("dataset_id",r.string().optional()),numTrials:r.property("num_trials",r.number().optional()),feedbackScores:r.property("feedback_scores",r.list(me).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 _d=r.enum_(["running","completed","cancelled","initialized","error"]);var zd=r.object({type:r.string(),parameters:pe.optional()});var kd=r.object({metrics:r.list(zd)});var Sd=r.object({model:r.string(),parameters:pe.optional()});var Pd=r.object({type:r.string(),parameters:pe.optional()});var Ad=r.object({role:r.string(),content:r.string()});var Td=r.object({messages:r.list(Ad)});var vd=r.object({datasetName:r.property("dataset_name",r.string()),prompt:Td,llmModel:r.property("llm_model",Sd),evaluation:kd,optimizer:Pd});var si=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:_d,metadata:ye.optional(),studioConfig:r.property("studio_config",vd.optional()),datasetId:r.property("dataset_id",r.string().optional()),numTrials:r.property("num_trials",r.number().optional()),feedbackScores:r.property("feedback_scores",r.list(nr).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 jd=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(si).optional(),sortableBy:r.list(r.string()).optional()});var Ed=r.object({type:r.string(),parameters:he.optional()});var Cd=r.object({metrics:r.list(Ed)});var Id=r.object({model:r.string(),parameters:he.optional()});var Dd=r.object({type:r.string(),parameters:he.optional()});var Ud=r.object({role:r.string(),content:r.string()});var Fd=r.object({messages:r.list(Ud)});var Nd=r.object({datasetName:r.property("dataset_name",r.string()),prompt:Fd,llmModel:r.property("llm_model",Id),evaluation:Cd,optimizer:Dd});var Md=r.object({url:r.string().optional(),lastModified:r.property("last_modified",r.date().optional()),expiresAt:r.property("expires_at",r.date().optional())});var Wd=r.enum_(["running","completed","cancelled","initialized","error"]);var Va=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:Wd,metadata:ge.optional(),studioConfig:r.property("studio_config",Nd.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var Bd=r.object({columns:r.list(Nl).optional()});var Vd=r.object({value:ri.optional()});var Ld=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var Hd=r.enum_(["private","public"]);var Zx=r.object({id:r.string().optional(),name:r.string(),visibility:Hd.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(me).optional()),duration:Me.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()),threadCount:r.property("thread_count",r.number().optional()),guardrailsFailedCount:r.property("guardrails_failed_count",r.number().optional()),errorCount:r.property("error_count",Zo.optional())});var Jd=r.enum_(["private","public"]);var Gd=r.object({id:r.string().optional(),name:r.string(),visibility:Jd.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(Qm).optional()),duration:Ld.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()),threadCount:r.property("thread_count",r.number().optional()),guardrailsFailedCount:r.property("guardrails_failed_count",r.number().optional()),errorCount:r.property("error_count",bm.optional())});var Kd=r.enum_(["HOURLY","DAILY","WEEKLY"]);var $d=r.enum_(["FEEDBACK_SCORES","TRACE_COUNT","TOKEN_USAGE","DURATION","COST","GUARDRAILS_FAILED_COUNT","THREAD_COUNT","THREAD_DURATION","THREAD_FEEDBACK_SCORES","SPAN_FEEDBACK_SCORES","SPAN_COUNT","SPAN_DURATION","SPAN_TOKEN_USAGE"]);var Qd=r.object({name:r.string().optional(),data:r.list($l).optional()});var Yd=r.object({projectId:r.property("project_id",r.string().optional()),metricType:r.property("metric_type",$d.optional()),interval:Kd.optional(),results:r.list(Qd).optional()});var Xd=r.enum_(["private","public"]);var pi=r.object({id:r.string().optional(),name:r.string(),visibility:Xd.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 Zd=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(pi).optional(),sortableBy:r.list(r.string()).optional()});var Od=r.object({name:r.string().optional()}),qd=r.union("type",{PERCENTAGE:Vd.extend(Od),COUNT:Gl.extend(Od),AVG:nl.extend(Od)}).transform({transform:n=>n,untransform:n=>n});var Je=r.object({stats:r.list(qd).optional()});var eu=r.object({projectId:r.property("project_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(me).optional()),duration:Me.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()),threadCount:r.property("thread_count",r.number().optional()),guardrailsFailedCount:r.property("guardrails_failed_count",r.number().optional()),errorCount:r.property("error_count",Zo.optional())});var ru=r.object({content:r.list(eu).optional()});var tu=r.enum_(["text","chat"]);var ou=r.enum_(["mustache","jinja2"]);var iu=r.enum_(["text","chat"]);var au=r.enum_(["mustache","jinja2"]);var nu=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:B.optional(),type:au.optional(),changeDescription:r.property("change_description",r.string().optional()),tags:r.list(r.string()).optional(),variables:r.list(r.string()).optional(),templateStructure:r.property("template_structure",iu.optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Ox=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),template:r.string().optional(),metadata:B.optional(),changeDescription:r.property("change_description",r.string().optional()),type:ou.optional(),templateStructure:r.property("template_structure",tu.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",nu.optional())});var su=r.enum_(["text","chat"]);var pu=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),templateStructure:r.property("template_structure",su.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",Ee.optional())});var cu=r.enum_(["text","chat"]);var lu=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),templateStructure:r.property("template_structure",cu.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 mu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(lu).optional(),sortableBy:r.list(r.string()).optional()});var du=r.enum_(["text","chat"]);var uu=r.enum_(["mustache","jinja2"]);var fu=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:pe.optional(),type:uu.optional(),changeDescription:r.property("change_description",r.string().optional()),tags:r.list(r.string()).optional(),templateStructure:r.property("template_structure",du.optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var hu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(fu).optional(),sortableBy:r.list(r.string()).optional()});var gu=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","bedrock","custom-llm","opik-free"]);var qx=r.object({id:r.string().optional(),provider:gu,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()),readOnly:r.property("read_only",r.boolean().optional())});var yu=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","bedrock","custom-llm","opik-free"]);var ci=r.object({id:r.string().optional(),provider:yu,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()),readOnly:r.property("read_only",r.boolean().optional())});var bu=r.object({size:r.number().optional(),total:r.number().optional(),content:r.list(ci).optional(),sortableBy:r.list(r.string()).optional()});var xr=r.object({name:r.string().optional(),current:r.number().optional(),previous:r.number().optional()});var xu=r.object({pythonEvaluatorEnabled:r.boolean(),traceThreadPythonEvaluatorEnabled:r.boolean(),spanLlmAsJudgeEnabled:r.boolean(),spanUserDefinedMetricPythonEnabled:r.boolean(),guardrailsEnabled:r.boolean(),opikAiEnabled:r.property("opikAIEnabled",r.boolean()),alertsEnabled:r.boolean(),welcomeWizardEnabled:r.boolean(),csvUploadEnabled:r.boolean(),exportEnabled:r.boolean(),optimizationStudioEnabled:r.boolean(),datasetVersioningEnabled:r.boolean(),datasetExportEnabled:r.boolean(),openaiProviderEnabled:r.boolean(),anthropicProviderEnabled:r.boolean(),geminiProviderEnabled:r.boolean(),openrouterProviderEnabled:r.boolean(),vertexaiProviderEnabled:r.boolean(),bedrockProviderEnabled:r.boolean(),customllmProviderEnabled:r.boolean(),collaboratorsTabEnabled:r.boolean()});var eR=r.object({spans:r.list(qo)});var Ru=r.enum_(["general","tool","llm","guardrail"]);var li=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:Ru.optional(),startTime:r.property("start_time",r.date()),endTime:r.property("end_time",r.date().optional()),input:ye.optional(),output:ye.optional(),metadata:ye.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",Oo.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(Jr).optional()),comments:r.list(gr).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 wu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(li).optional(),sortableBy:r.list(r.string()).optional()});var _u=r.object({workspace:r.string().optional(),spanCount:r.property("span_count",r.number().optional())});var zu=r.object({workspacesSpansCount:r.property("workspaces_spans_count",r.list(_u).optional())});var ku=r.object({uploadId:r.property("upload_id",r.string()),preSignUrls:r.property("pre_sign_urls",r.list(r.string()))});var rR=r.object({traces:r.list(ei)});var Su=r.object({workspace:r.string().optional(),traceCount:r.property("trace_count",r.number().optional())});var Pu=r.object({workspacesTracesCount:r.property("workspaces_traces_count",r.list(Su).optional())});var Au=r.enum_(["default","hidden"]);var mi=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:ye.optional(),output:ye.optional(),metadata:ye.optional(),tags:r.list(r.string()).optional(),errorInfo:r.property("error_info",Oo.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(Jr).optional()),spanFeedbackScores:r.property("span_feedback_scores",r.list(Jr).optional()),comments:r.list(gr).optional(),guardrailsValidations:r.property("guardrails_validations",r.list(cd).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",Au.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 Tu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(mi).optional(),sortableBy:r.list(r.string()).optional()});var vu=r.enum_(["active","inactive"]);var di=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",K.optional()),lastMessage:r.property("last_message",K.optional()),feedbackScores:r.property("feedback_scores",r.list(se).optional()),status:vu.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(O).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 La=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 ju=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(di).optional(),sortableBy:r.list(r.string()).optional()});var Eu=r.object({responseExamples:r.property("response_examples",r.record(r.string(),r.record(r.string(),r.unknown())).optional())});var Cu=r.enum_(["success","failure"]);var Iu=r.object({status:Cu.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 Du=r.object({completed:r.boolean().optional()});var ui=r.object({timeoutToMarkThreadAsInactive:r.property("timeout_to_mark_thread_as_inactive",r.string().optional()),truncationOnTables:r.property("truncation_on_tables",r.boolean().optional())});var tR=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 Ha=r.object({results:r.list(xr).optional()});var Gr=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 Uu=r.object({results:r.list(xr).optional()});var Fu=r.object({workspaceName:r.property("workspace_name",r.string().optional())});var Ja=class{constructor(o={}){this._options=F(o);}findAlerts(o={},e){return _.fromPromise(this.__findAlerts(o,e))}async __findAlerts(o={},e){var d,m,f,u,h,g,x,T,v,E,C;let{page:t,size:i,sorting:a,filters:s}=o,p={page:t,size:i,sorting:a,filters:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/private/alerts"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:Ep.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});return A(c.error,c.rawResponse,"GET","/v1/private/alerts")}createAlert(o,e){return _.fromPromise(this.__createAlert(o,e))}async __createAlert(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/alerts"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ko.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 409:throw new $(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/alerts")}deleteAlertBatch(o,e){return _.fromPromise(this.__deleteAlertBatch(o,e))}async __deleteAlertBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/alerts/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/alerts/delete")}getAlertById(o,e={},t){return _.fromPromise(this.__getAlertById(o,e,t))}async __getAlertById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/alerts/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:zo.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/alerts/{id}")}updateAlert(o,e,t){return _.fromPromise(this.__updateAlert(o,e,t))}async __updateAlert(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/alerts/${R.encodePathParam(o)}`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ko.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new D(s.error.body,s.rawResponse);case 409:throw new $(s.error.body,s.rawResponse);case 422:throw new Z(s.error.body,s.rawResponse);default:throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return A(s.error,s.rawResponse,"PUT","/v1/private/alerts/{id}")}getWebhookExamples(o={},e){return _.fromPromise(this.__getWebhookExamples(o,e))}async __getWebhookExamples(o={},e){var p,l,c,d,m,f,u,h,g,x,T;let{alertType:t}=o,i={alert_type:t!=null?Yi.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0},a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=e==null?void 0:e.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),e==null?void 0:e.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,"v1/private/alerts/webhooks/examples"),method:"GET",headers:a,queryParameters:{...i,...e==null?void 0:e.queryParams},timeoutMs:((h=(u=e==null?void 0:e.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=e==null?void 0:e.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:Eu.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/alerts/webhooks/examples")}testWebhook(o,e){return _.fromPromise(this.__testWebhook(o,e))}async __testWebhook(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/alerts/webhooks/tests"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ko.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Iu.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===422?new Z(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/alerts/webhooks/tests")}};var Ga=class{constructor(o={}){this._options=F(o);}addItemsToAnnotationQueue(o,e,t){return _.fromPromise(this.__addItemsToAnnotationQueue(o,e,t))}async __addItemsToAnnotationQueue(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/annotation-queues/${R.encodePathParam(o)}/items/add`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Fa.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/annotation-queues/{id}/items/add")}findAnnotationQueues(o={},e){return _.fromPromise(this.__findAnnotationQueues(o,e))}async __findAnnotationQueues(o={},e){var m,f,u,h,g,x,T,v,E,C,U;let{page:t,size:i,name:a,filters:s,sorting:p}=o,l={page:t,size:i,name:a,filters:s,sorting:p},c=z((m=this._options)==null?void 0:m.headers,P({"Comet-Workspace":(u=e==null?void 0:e.workspaceName)!=null?u:(f=this._options)==null?void 0:f.workspaceName}),e==null?void 0:e.headers),d=await k({url:R.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:S.Default,"v1/private/annotation-queues"),method:"GET",headers:c,queryParameters:{...l,...e==null?void 0:e.queryParams},timeoutMs:((v=(T=e==null?void 0:e.timeoutInSeconds)!=null?T:(x=this._options)==null?void 0:x.timeoutInSeconds)!=null?v:60)*1e3,maxRetries:(C=e==null?void 0:e.maxRetries)!=null?C:(E=this._options)==null?void 0:E.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(U=this._options)==null?void 0:U.fetch,logging:this._options.logging});if(d.ok)return {data:Hp.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")throw new w({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse});return A(d.error,d.rawResponse,"GET","/v1/private/annotation-queues")}createAnnotationQueue(o,e){return _.fromPromise(this.__createAnnotationQueue(o,e))}async __createAnnotationQueue(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/annotation-queues"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ct.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/annotation-queues")}createAnnotationQueueBatch(o,e){return _.fromPromise(this.__createAnnotationQueueBatch(o,e))}async __createAnnotationQueueBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/annotation-queues/batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:lt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 409:throw new $(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/annotation-queues/batch")}deleteAnnotationQueueBatch(o,e){return _.fromPromise(this.__deleteAnnotationQueueBatch(o,e))}async __deleteAnnotationQueueBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/annotation-queues/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/annotation-queues/delete")}getAnnotationQueueById(o,e={},t){return _.fromPromise(this.__getAnnotationQueueById(o,e,t))}async __getAnnotationQueueById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/annotation-queues/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:So.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/annotation-queues/{id}")}updateAnnotationQueue(o,e={},t){return _.fromPromise(this.__updateAnnotationQueue(o,e,t))}async __updateAnnotationQueue(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/annotation-queues/${R.encodePathParam(o)}`),method:"PATCH",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:mt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===400?new D(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"PATCH","/v1/private/annotation-queues/{id}")}removeItemsFromAnnotationQueue(o,e,t){return _.fromPromise(this.__removeItemsFromAnnotationQueue(o,e,t))}async __removeItemsFromAnnotationQueue(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/annotation-queues/${R.encodePathParam(o)}/items/delete`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Fa.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/annotation-queues/{id}/items/delete")}};var Ka=class{constructor(o={}){this._options=F(o);}attachmentList(o,e){return _.fromPromise(this.__attachmentList(o,e))}async __attachmentList(o,e){var f,u,h,g,x,T,v,E,C,U,M;let{page:t,size:i,projectId:a,entityType:s,entityId:p,path:l}=o,c={page:t,size:i,project_id:a,entity_type:ea.jsonOrThrow(s,{unrecognizedObjectKeys:"strip",omitUndefined:true}),entity_id:p,path:l},d=z((f=this._options)==null?void 0:f.headers,P({"Comet-Workspace":(h=e==null?void 0:e.workspaceName)!=null?h:(u=this._options)==null?void 0:u.workspaceName}),e==null?void 0:e.headers),m=await k({url:R.join((x=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?x:S.Default,"v1/private/attachment/list"),method:"GET",headers:d,queryParameters:{...c,...e==null?void 0:e.queryParams},timeoutMs:((E=(v=e==null?void 0:e.timeoutInSeconds)!=null?v:(T=this._options)==null?void 0:T.timeoutInSeconds)!=null?E:60)*1e3,maxRetries:(U=e==null?void 0:e.maxRetries)!=null?U:(C=this._options)==null?void 0:C.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(M=this._options)==null?void 0:M.fetch,logging:this._options.logging});if(m.ok)return {data:Qp.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 401:throw new re(m.error.body,m.rawResponse);case 403:throw new ne(de.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new w({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return A(m.error,m.rawResponse,"GET","/v1/private/attachment/list")}completeMultiPartUpload(o,e){return _.fromPromise(this.__completeMultiPartUpload(o,e))}async __completeMultiPartUpload(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/attachment/upload-complete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Na.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 401:throw new re(i.error.body,i.rawResponse);case 403:throw new ne(de.parseOrThrow(i.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/attachment/upload-complete")}deleteAttachments(o,e){return _.fromPromise(this.__deleteAttachments(o,e))}async __deleteAttachments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/attachment/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Na.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 401:throw new re(i.error.body,i.rawResponse);case 403:throw new ne(de.parseOrThrow(i.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/attachment/delete")}downloadAttachment(o,e){return _.fromPromise(this.__downloadAttachment(o,e))}async __downloadAttachment(o,e){var f,u,h,g,x,T,v,E,C,U,M;let{workspaceName:t,containerId:i,entityType:a,entityId:s,fileName:p,mimeType:l}=o,c={workspace_name:t,container_id:i,entity_type:ra.jsonOrThrow(a,{unrecognizedObjectKeys:"strip",omitUndefined:true}),entity_id:s,file_name:p,mime_type:l},d=z((f=this._options)==null?void 0:f.headers,P({"Comet-Workspace":(h=e==null?void 0:e.workspaceName)!=null?h:(u=this._options)==null?void 0:u.workspaceName}),e==null?void 0:e.headers),m=await k({url:R.join((x=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?x:S.Default,"v1/private/attachment/download"),method:"GET",headers:d,queryParameters:{...c,...e==null?void 0:e.queryParams},responseType:"streaming",timeoutMs:((E=(v=e==null?void 0:e.timeoutInSeconds)!=null?v:(T=this._options)==null?void 0:T.timeoutInSeconds)!=null?E:60)*1e3,maxRetries:(U=e==null?void 0:e.maxRetries)!=null?U:(C=this._options)==null?void 0:C.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(M=this._options)==null?void 0:M.fetch,logging:this._options.logging});if(m.ok)return {data:m.body,rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 401:throw new re(m.error.body,m.rawResponse);case 403:throw new ne(de.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new w({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return A(m.error,m.rawResponse,"GET","/v1/private/attachment/download")}startMultiPartUpload(o,e){return _.fromPromise(this.__startMultiPartUpload(o,e))}async __startMultiPartUpload(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/attachment/upload-start"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:dt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:ku.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 401:throw new re(i.error.body,i.rawResponse);case 403:throw new ne(de.parseOrThrow(i.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/attachment/upload-start")}uploadAttachment(o,e){return _.fromPromise(this.__uploadAttachment(o,e))}async __uploadAttachment(o,e){var f,u,h,g,x,T,v,E,C,U,M;let{fileName:t,projectName:i,mimeType:a,entityType:s,entityId:p,body:l}=o,c={file_name:t,project_name:i,mime_type:a,entity_type:ta.jsonOrThrow(s,{unrecognizedObjectKeys:"strip",omitUndefined:true}),entity_id:p},d=z((f=this._options)==null?void 0:f.headers,P({"Comet-Workspace":(h=e==null?void 0:e.workspaceName)!=null?h:(u=this._options)==null?void 0:u.workspaceName}),e==null?void 0:e.headers),m=await k({url:R.join((x=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?x:S.Default,"v1/private/attachment/upload"),method:"PUT",headers:d,contentType:"application/json",queryParameters:{...c,...e==null?void 0:e.queryParams},requestType:"json",body:Er.uploadAttachment.Request.jsonOrThrow(l,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((E=(v=e==null?void 0:e.timeoutInSeconds)!=null?v:(T=this._options)==null?void 0:T.timeoutInSeconds)!=null?E:60)*1e3,maxRetries:(U=e==null?void 0:e.maxRetries)!=null?U:(C=this._options)==null?void 0:C.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(M=this._options)==null?void 0:M.fetch,logging:this._options.logging});if(m.ok)return {data:void 0,rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 401:throw new re(m.error.body,m.rawResponse);case 403:throw new ne(de.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new w({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return A(m.error,m.rawResponse,"PUT","/v1/private/attachment/upload")}};var $a=class{constructor(o={}){this._options=F(o);}findEvaluators(o={},e){return _.fromPromise(this.__findEvaluators(o,e))}async __findEvaluators(o={},e){var u,h,g,x,T,v,E,C,U,M,X;let{projectId:t,id:i,name:a,filters:s,sorting:p,page:l,size:c}=o,d={project_id:t,id:i,name:a,filters:s,sorting:p,page:l,size:c},m=z((u=this._options)==null?void 0:u.headers,P({"Comet-Workspace":(g=e==null?void 0:e.workspaceName)!=null?g:(h=this._options)==null?void 0:h.workspaceName}),e==null?void 0:e.headers),f=await k({url:R.join((T=(x=await b.get(this._options.baseUrl))!=null?x:await b.get(this._options.environment))!=null?T:S.Default,"v1/private/automations/evaluators"),method:"GET",headers:m,queryParameters:{...d,...e==null?void 0:e.queryParams},timeoutMs:((C=(E=e==null?void 0:e.timeoutInSeconds)!=null?E:(v=this._options)==null?void 0:v.timeoutInSeconds)!=null?C:60)*1e3,maxRetries:(M=e==null?void 0:e.maxRetries)!=null?M:(U=this._options)==null?void 0:U.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(X=this._options)==null?void 0:X.fetch,logging:this._options.logging});if(f.ok)return {data:Uc.parseOrThrow(f.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:f.rawResponse};if(f.error.reason==="status-code")throw new w({statusCode:f.error.statusCode,body:f.error.body,rawResponse:f.rawResponse});return A(f.error,f.rawResponse,"GET","/v1/private/automations/evaluators")}createAutomationRuleEvaluator(o,e){return _.fromPromise(this.__createAutomationRuleEvaluator(o,e))}async __createAutomationRuleEvaluator(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/automations/evaluators"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:al.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/automations/evaluators")}deleteAutomationRuleEvaluatorBatch(o,e){return _.fromPromise(this.__deleteAutomationRuleEvaluatorBatch(o,e))}async __deleteAutomationRuleEvaluatorBatch(o,e){var l,c,d,m,f,u,h,g,x,T,v;let{projectId:t,body:i}=o,a={project_id:t},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=e==null?void 0:e.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),e==null?void 0:e.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,"v1/private/automations/evaluators/delete"),method:"POST",headers:s,contentType:"application/json",queryParameters:{...a,...e==null?void 0:e.queryParams},requestType:"json",body:Y.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((g=(h=e==null?void 0:e.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=e==null?void 0:e.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:void 0,rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"POST","/v1/private/automations/evaluators/delete")}getEvaluatorById(o,e={},t){return _.fromPromise(this.__getEvaluatorById(o,e,t))}async __getEvaluatorById(o,e={},t){var l,c,d,m,f,u,h,g,x,T,v;let{projectId:i}=e,a={project_id:i},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=t==null?void 0:t.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),t==null?void 0:t.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,`v1/private/automations/evaluators/${R.encodePathParam(o)}`),method:"GET",headers:s,queryParameters:{...a,...t==null?void 0:t.queryParams},timeoutMs:((g=(h=t==null?void 0:t.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=t==null?void 0:t.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:Nc.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"GET","/v1/private/automations/evaluators/{id}")}updateAutomationRuleEvaluator(o,e,t){return _.fromPromise(this.__updateAutomationRuleEvaluator(o,e,t))}async __updateAutomationRuleEvaluator(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/automations/evaluators/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:rl.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/automations/evaluators/{id}")}getEvaluatorLogsById(o,e={},t){return _.fromPromise(this.__getEvaluatorLogsById(o,e,t))}async __getEvaluatorLogsById(o,e={},t){var l,c,d,m,f,u,h,g,x,T,v;let{size:i}=e,a={size:i},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=t==null?void 0:t.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),t==null?void 0:t.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,`v1/private/automations/evaluators/${R.encodePathParam(o)}/logs`),method:"GET",headers:s,queryParameters:{...a,...t==null?void 0:t.queryParams},timeoutMs:((g=(h=t==null?void 0:t.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=t==null?void 0:t.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:dd.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"GET","/v1/private/automations/evaluators/{id}/logs")}};var Qa=class{constructor(o={}){this._options=F(o);}createChatCompletions(o={},e){return _.fromPromise(this.__createChatCompletions(o,e))}async __createChatCompletions(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/chat/completions"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ft.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Al.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/chat/completions")}};var Ya=class{constructor(o={}){this._options=F(o);}access(o,e){return _.fromPromise(this.__access(o,e))}async __access(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/auth"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Op.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 401:throw new re(i.error.body,i.rawResponse);case 403:throw new ne(de.parseOrThrow(i.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/auth")}getWorkspaceName(o){return _.fromPromise(this.__getWorkspaceName(o))}async __getWorkspaceName(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/auth/workspace"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Fu.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")switch(t.error.statusCode){case 401:throw new re(t.error.body,t.rawResponse);case 403:throw new ne(de.parseOrThrow(t.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),t.rawResponse);default:throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse})}return A(t.error,t.rawResponse,"GET","/v1/private/auth/workspace")}};var Xa=class{constructor(o={}){this._options=F(o);}findDashboards(o={},e){return _.fromPromise(this.__findDashboards(o,e))}async __findDashboards(o={},e){var d,m,f,u,h,g,x,T,v,E,C;let{page:t,size:i,name:a,sorting:s}=o,p={page:t,size:i,name:a,sorting:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/private/dashboards"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:Kl.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});return A(c.error,c.rawResponse,"GET","/v1/private/dashboards")}createDashboard(o,e){return _.fromPromise(this.__createDashboard(o,e))}async __createDashboard(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/dashboards"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:gt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:yr.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/dashboards")}getDashboardById(o,e={},t){return _.fromPromise(this.__getDashboardById(o,e,t))}async __getDashboardById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/dashboards/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:yr.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/dashboards/{dashboardId}")}deleteDashboard(o,e={},t){return _.fromPromise(this.__deleteDashboard(o,e,t))}async __deleteDashboard(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/dashboards/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/dashboards/{dashboardId}")}updateDashboard(o,e={},t){return _.fromPromise(this.__updateDashboard(o,e,t))}async __updateDashboard(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/dashboards/${R.encodePathParam(o)}`),method:"PATCH",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ht.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:yr.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 404:throw new I(a.error.body,a.rawResponse);case 409:throw new $(a.error.body,a.rawResponse);default:throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}return A(a.error,a.rawResponse,"PATCH","/v1/private/dashboards/{dashboardId}")}deleteDashboardsBatch(o,e){return _.fromPromise(this.__deleteDashboardsBatch(o,e))}async __deleteDashboardsBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/dashboards/delete-batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/dashboards/delete-batch")}};var Za=class{constructor(o={}){this._options=F(o);}applyDatasetItemChanges(o,e,t){return _.fromPromise(this.__applyDatasetItemChanges(o,e,t))}async __applyDatasetItemChanges(o,e,t){var c,d,m,f,u,h,g,x,T,v,E;let{override:i,body:a}=e,s={override:i},p=z((c=this._options)==null?void 0:c.headers,P({"Comet-Workspace":(m=t==null?void 0:t.workspaceName)!=null?m:(d=this._options)==null?void 0:d.workspaceName}),t==null?void 0:t.headers),l=await k({url:R.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items/changes`),method:"POST",headers:p,contentType:"application/json",queryParameters:{...s,...t==null?void 0:t.queryParams},requestType:"json",body:Ol.jsonOrThrow(a,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((x=(g=t==null?void 0:t.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?x:60)*1e3,maxRetries:(v=t==null?void 0:t.maxRetries)!=null?v:(T=this._options)==null?void 0:T.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(E=this._options)==null?void 0:E.fetch,logging:this._options.logging});if(l.ok)return {data:br.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new D(l.error.body,l.rawResponse);case 404:throw new I(l.error.body,l.rawResponse);case 409:throw new $(l.error.body,l.rawResponse);default:throw new w({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return A(l.error,l.rawResponse,"POST","/v1/private/datasets/{id}/items/changes")}batchUpdateDatasetItems(o,e){return _.fromPromise(this.__batchUpdateDatasetItems(o,e))}async __batchUpdateDatasetItems(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/items/batch"),method:"PATCH",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:zt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PATCH","/v1/private/datasets/items/batch")}findDatasets(o={},e){return _.fromPromise(this.__findDatasets(o,e))}async __findDatasets(o={},e){var h,g,x,T,v,E,C,U,M,X,ie;let{page:t,size:i,withExperimentsOnly:a,withOptimizationsOnly:s,promptId:p,name:l,sorting:c,filters:d}=o,m={page:t,size:i,with_experiments_only:a,with_optimizations_only:s,prompt_id:p,name:l,sorting:c,filters:d},f=z((h=this._options)==null?void 0:h.headers,P({"Comet-Workspace":(x=e==null?void 0:e.workspaceName)!=null?x:(g=this._options)==null?void 0:g.workspaceName}),e==null?void 0:e.headers),u=await k({url:R.join((v=(T=await b.get(this._options.baseUrl))!=null?T:await b.get(this._options.environment))!=null?v:S.Default,"v1/private/datasets"),method:"GET",headers:f,queryParameters:{...m,...e==null?void 0:e.queryParams},timeoutMs:((U=(C=e==null?void 0:e.timeoutInSeconds)!=null?C:(E=this._options)==null?void 0:E.timeoutInSeconds)!=null?U:60)*1e3,maxRetries:(X=e==null?void 0:e.maxRetries)!=null?X:(M=this._options)==null?void 0:M.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(ie=this._options)==null?void 0:ie.fetch,logging:this._options.logging});if(u.ok)return {data:um.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")throw new w({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse});return A(u.error,u.rawResponse,"GET","/v1/private/datasets")}createDataset(o,e){return _.fromPromise(this.__createDataset(o,e))}async __createDataset(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ct.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/datasets")}createOrUpdateDatasetItems(o,e){return _.fromPromise(this.__createOrUpdateDatasetItems(o,e))}async __createOrUpdateDatasetItems(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/items"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:St.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/datasets/items")}createDatasetItemsFromCsv(o,e){return _.fromPromise(this.__createDatasetItemsFromCsv(o,e))}async __createDatasetItemsFromCsv(o,e){var p,l,c,d,m,f,u,h,g,x,T;let t=await qf();t.append("file",Se(o.file)),t.append("dataset_id",o.datasetId);let i=await t.getRequest(),a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=e==null?void 0:e.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName,...i.headers}),e==null?void 0:e.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,"v1/private/datasets/items/from-csv"),method:"POST",headers:a,queryParameters:e==null?void 0:e.queryParams,requestType:"file",duplex:i.duplex,body:i.body,timeoutMs:((h=(u=e==null?void 0:e.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=e==null?void 0:e.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new D(s.error.body,s.rawResponse);case 404:throw new I(s.error.body,s.rawResponse);default:throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return A(s.error,s.rawResponse,"POST","/v1/private/datasets/items/from-csv")}createDatasetItemsFromSpans(o,e,t){return _.fromPromise(this.__createDatasetItemsFromSpans(o,e,t))}async __createDatasetItemsFromSpans(o,e,t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items/from-spans`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:yt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"POST","/v1/private/datasets/{dataset_id}/items/from-spans")}createDatasetItemsFromTraces(o,e,t){return _.fromPromise(this.__createDatasetItemsFromTraces(o,e,t))}async __createDatasetItemsFromTraces(o,e,t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items/from-traces`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:bt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"POST","/v1/private/datasets/{dataset_id}/items/from-traces")}getDatasetById(o,e={},t){return _.fromPromise(this.__getDatasetById(o,e,t))}async __getDatasetById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Lr.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/datasets/{id}")}updateDataset(o,e,t){return _.fromPromise(this.__updateDataset(o,e,t))}async __updateDataset(o,e,t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}`),method:"PUT",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Tt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"PUT","/v1/private/datasets/{id}")}deleteDataset(o,e={},t){return _.fromPromise(this.__deleteDataset(o,e,t))}async __deleteDataset(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/datasets/{id}")}deleteDatasetByName(o,e){return _.fromPromise(this.__deleteDatasetByName(o,e))}async __deleteDatasetByName(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Rt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/datasets/delete")}deleteDatasetItems(o={},e){return _.fromPromise(this.__deleteDatasetItems(o,e))}async __deleteDatasetItems(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/items/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:At.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/datasets/items/delete")}deleteDatasetsBatch(o,e){return _.fromPromise(this.__deleteDatasetsBatch(o,e))}async __deleteDatasetsBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/delete-batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/datasets/delete-batch")}downloadDatasetExport(o,e={},t){return _.fromPromise(this.__downloadDatasetExport(o,e,t))}async __downloadDatasetExport(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/export-jobs/${R.encodePathParam(o)}/download`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,responseType:"streaming",timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:a.body,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new D(a.error.body,a.rawResponse);case 404:throw new I(a.error.body,a.rawResponse);default:throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}return A(a.error,a.rawResponse,"GET","/v1/private/datasets/export-jobs/{jobId}/download")}expandDataset(o,e,t){return _.fromPromise(this.__expandDataset(o,e,t))}async __expandDataset(o,e,t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/expansions`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:xt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Zl.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"POST","/v1/private/datasets/{id}/expansions")}findDatasetItemsWithExperimentItems(o,e,t){return _.fromPromise(this.__findDatasetItemsWithExperimentItems(o,e,t))}async __findDatasetItemsWithExperimentItems(o,e,t){var h,g,x,T,v,E,C,U,M,X,ie;let{page:i,size:a,experimentIds:s,filters:p,sorting:l,search:c,truncate:d}=e,m={page:i,size:a,experiment_ids:s,filters:p,sorting:l,search:c,truncate:d},f=z((h=this._options)==null?void 0:h.headers,P({"Comet-Workspace":(x=t==null?void 0:t.workspaceName)!=null?x:(g=this._options)==null?void 0:g.workspaceName}),t==null?void 0:t.headers),u=await k({url:R.join((v=(T=await b.get(this._options.baseUrl))!=null?T:await b.get(this._options.environment))!=null?v:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items/experiments/items`),method:"GET",headers:f,queryParameters:{...m,...t==null?void 0:t.queryParams},timeoutMs:((U=(C=t==null?void 0:t.timeoutInSeconds)!=null?C:(E=this._options)==null?void 0:E.timeoutInSeconds)!=null?U:60)*1e3,maxRetries:(X=t==null?void 0:t.maxRetries)!=null?X:(M=this._options)==null?void 0:M.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(ie=this._options)==null?void 0:ie.fetch,logging:this._options.logging});if(u.ok)return {data:sm.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")throw new w({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse});return A(u.error,u.rawResponse,"GET","/v1/private/datasets/{id}/items/experiments/items")}getDatasetByIdentifier(o,e){return _.fromPromise(this.__getDatasetByIdentifier(o,e))}async __getDatasetByIdentifier(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/retrieve"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:wt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Lr.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/datasets/retrieve")}getDatasetExperimentItemsStats(o,e,t){return _.fromPromise(this.__getDatasetExperimentItemsStats(o,e,t))}async __getDatasetExperimentItemsStats(o,e,t){var c,d,m,f,u,h,g,x,T,v,E;let{experimentIds:i,filters:a}=e,s={experiment_ids:i,filters:a},p=z((c=this._options)==null?void 0:c.headers,P({"Comet-Workspace":(m=t==null?void 0:t.workspaceName)!=null?m:(d=this._options)==null?void 0:d.workspaceName}),t==null?void 0:t.headers),l=await k({url:R.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items/experiments/items/stats`),method:"GET",headers:p,queryParameters:{...s,...t==null?void 0:t.queryParams},timeoutMs:((x=(g=t==null?void 0:t.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?x:60)*1e3,maxRetries:(v=t==null?void 0:t.maxRetries)!=null?v:(T=this._options)==null?void 0:T.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(E=this._options)==null?void 0:E.fetch,logging:this._options.logging});if(l.ok)return {data:Je.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")throw new w({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse});return A(l.error,l.rawResponse,"GET","/v1/private/datasets/{id}/items/experiments/items/stats")}getDatasetExportJob(o,e={},t){return _.fromPromise(this.__getDatasetExportJob(o,e,t))}async __getDatasetExportJob(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/export-jobs/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Cr.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/datasets/export-jobs/{jobId}")}getDatasetExportJobs(o){return _.fromPromise(this.__getDatasetExportJobs(o))}async __getDatasetExportJobs(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/datasets/export-jobs"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Ir.getDatasetExportJobs.Response.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/private/datasets/export-jobs")}getDatasetItemById(o,e={},t){return _.fromPromise(this.__getDatasetItemById(o,e,t))}async __getDatasetItemById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/items/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Qo.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/datasets/items/{itemId}")}patchDatasetItem(o,e,t){return _.fromPromise(this.__patchDatasetItem(o,e,t))}async __patchDatasetItem(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/datasets/items/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:kt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/datasets/items/{itemId}")}getDatasetItems(o,e={},t){return _.fromPromise(this.__getDatasetItems(o,e,t))}async __getDatasetItems(o,e={},t){var f,u,h,g,x,T,v,E,C,U,M;let{page:i,size:a,version:s,filters:p,truncate:l}=e,c={page:i,size:a,version:s,filters:p,truncate:l},d=z((f=this._options)==null?void 0:f.headers,P({"Comet-Workspace":(h=t==null?void 0:t.workspaceName)!=null?h:(u=this._options)==null?void 0:u.workspaceName}),t==null?void 0:t.headers),m=await k({url:R.join((x=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?x:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items`),method:"GET",headers:d,queryParameters:{...c,...t==null?void 0:t.queryParams},timeoutMs:((E=(v=t==null?void 0:t.timeoutInSeconds)!=null?v:(T=this._options)==null?void 0:T.timeoutInSeconds)!=null?E:60)*1e3,maxRetries:(U=t==null?void 0:t.maxRetries)!=null?U:(C=this._options)==null?void 0:C.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(M=this._options)==null?void 0:M.fetch,logging:this._options.logging});if(m.ok)return {data:lm.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")throw new w({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse});return A(m.error,m.rawResponse,"GET","/v1/private/datasets/{id}/items")}getDatasetItemsOutputColumns(o,e={},t){return _.fromPromise(this.__getDatasetItemsOutputColumns(o,e,t))}async __getDatasetItemsOutputColumns(o,e={},t){var l,c,d,m,f,u,h,g,x,T,v;let{experimentIds:i}=e,a={experiment_ids:i},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=t==null?void 0:t.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),t==null?void 0:t.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/items/experiments/items/output/columns`),method:"GET",headers:s,queryParameters:{...a,...t==null?void 0:t.queryParams},timeoutMs:((g=(h=t==null?void 0:t.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=t==null?void 0:t.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:Bd.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"GET","/v1/private/datasets/{id}/items/experiments/items/output/columns")}markDatasetExportJobViewed(o,e={},t){return _.fromPromise(this.__markDatasetExportJobViewed(o,e,t))}async __markDatasetExportJobViewed(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/export-jobs/${R.encodePathParam(o)}/mark-viewed`),method:"PUT",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"PUT","/v1/private/datasets/export-jobs/{jobId}/mark-viewed")}startDatasetExport(o,e={},t){return _.fromPromise(this.__startDatasetExport(o,e,t))}async __startDatasetExport(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/export`),method:"POST",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Cr.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"POST","/v1/private/datasets/{id}/export")}streamDatasetItems(o,e){return _.fromPromise(this.__streamDatasetItems(o,e))}async __streamDatasetItems(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/datasets/items/stream"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Pt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),responseType:"streaming",timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:i.body,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/datasets/items/stream")}compareDatasetVersions(o,e={},t){return _.fromPromise(this.__compareDatasetVersions(o,e,t))}async __compareDatasetVersions(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/versions/diff`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:hm.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/datasets/{id}/versions/diff")}createVersionTag(o,e,t,i){return _.fromPromise(this.__createVersionTag(o,e,t,i))}async __createVersionTag(o,e,t,i){var p,l,c,d,m,f,u,h,g,x,T;let a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=i==null?void 0:i.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),i==null?void 0:i.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/versions/hash/${R.encodePathParam(e)}/tags`),method:"POST",headers:a,contentType:"application/json",queryParameters:i==null?void 0:i.queryParams,requestType:"json",body:jt.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=i==null?void 0:i.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=i==null?void 0:i.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:i==null?void 0:i.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new D(s.error.body,s.rawResponse);case 404:throw new I(s.error.body,s.rawResponse);case 409:throw new $(s.error.body,s.rawResponse);default:throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return A(s.error,s.rawResponse,"POST","/v1/private/datasets/{id}/versions/hash/{versionHash}/tags")}deleteVersionTag(o,e,t,i={},a){return _.fromPromise(this.__deleteVersionTag(o,e,t,i,a))}async __deleteVersionTag(o,e,t,i={},a){var l,c,d,m,f,u,h,g,x,T,v;let s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=a==null?void 0:a.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),a==null?void 0:a.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/versions/${R.encodePathParam(e)}/tags/${R.encodePathParam(t)}`),method:"DELETE",headers:s,queryParameters:a==null?void 0:a.queryParams,timeoutMs:((g=(h=a==null?void 0:a.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=a==null?void 0:a.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:a==null?void 0:a.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:void 0,rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"DELETE","/v1/private/datasets/{id}/versions/{versionHash}/tags/{tag}")}listDatasetVersions(o,e={},t){return _.fromPromise(this.__listDatasetVersions(o,e,t))}async __listDatasetVersions(o,e={},t){var c,d,m,f,u,h,g,x,T,v,E;let{page:i,size:a}=e,s={page:i,size:a},p=z((c=this._options)==null?void 0:c.headers,P({"Comet-Workspace":(m=t==null?void 0:t.workspaceName)!=null?m:(d=this._options)==null?void 0:d.workspaceName}),t==null?void 0:t.headers),l=await k({url:R.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/versions`),method:"GET",headers:p,queryParameters:{...s,...t==null?void 0:t.queryParams},timeoutMs:((x=(g=t==null?void 0:t.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?x:60)*1e3,maxRetries:(v=t==null?void 0:t.maxRetries)!=null?v:(T=this._options)==null?void 0:T.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(E=this._options)==null?void 0:E.fetch,logging:this._options.logging});if(l.ok)return {data:gm.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")throw l.error.statusCode===400?new D(l.error.body,l.rawResponse):new w({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse});return A(l.error,l.rawResponse,"GET","/v1/private/datasets/{id}/versions")}restoreDatasetVersion(o,e,t){return _.fromPromise(this.__restoreDatasetVersion(o,e,t))}async __restoreDatasetVersion(o,e,t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/versions/restore`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:vt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:br.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"POST","/v1/private/datasets/{id}/versions/restore")}updateDatasetVersion(o,e,t={},i){return _.fromPromise(this.__updateDatasetVersion(o,e,t,i))}async __updateDatasetVersion(o,e,t={},i){var p,l,c,d,m,f,u,h,g,x,T;let a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=i==null?void 0:i.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),i==null?void 0:i.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/datasets/${R.encodePathParam(o)}/versions/hash/${R.encodePathParam(e)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:i==null?void 0:i.queryParams,requestType:"json",body:Et.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=i==null?void 0:i.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=i==null?void 0:i.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:i==null?void 0:i.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:br.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new D(s.error.body,s.rawResponse);case 404:throw new I(s.error.body,s.rawResponse);case 409:throw new $(s.error.body,s.rawResponse);default:throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return A(s.error,s.rawResponse,"PATCH","/v1/private/datasets/{id}/versions/hash/{versionHash}")}};var Oa=class{constructor(o={}){this._options=F(o);}batchUpdateExperiments(o,e){return _.fromPromise(this.__batchUpdateExperiments(o,e))}async __batchUpdateExperiments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/batch"),method:"PATCH",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ut.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PATCH","/v1/private/experiments/batch")}findExperiments(o={},e){return _.fromPromise(this.__findExperiments(o,e))}async __findExperiments(o={},e){var C,U,M,X,ie,ze,ke,Ve,et,rt,Ou;let{page:t,size:i,datasetId:a,optimizationId:s,types:p,name:l,datasetDeleted:c,promptId:d,projectId:m,projectDeleted:f,sorting:u,filters:h,experimentIds:g,forceSorting:x}=o,T={page:t,size:i,datasetId:a,optimization_id:s,types:p,name:l,dataset_deleted:c,prompt_id:d,project_id:m,project_deleted:f,sorting:u,filters:h,experiment_ids:g,force_sorting:x},v=z((C=this._options)==null?void 0:C.headers,P({"Comet-Workspace":(M=e==null?void 0:e.workspaceName)!=null?M:(U=this._options)==null?void 0:U.workspaceName}),e==null?void 0:e.headers),E=await k({url:R.join((ie=(X=await b.get(this._options.baseUrl))!=null?X:await b.get(this._options.environment))!=null?ie:S.Default,"v1/private/experiments"),method:"GET",headers:v,queryParameters:{...T,...e==null?void 0:e.queryParams},timeoutMs:((Ve=(ke=e==null?void 0:e.timeoutInSeconds)!=null?ke:(ze=this._options)==null?void 0:ze.timeoutInSeconds)!=null?Ve:60)*1e3,maxRetries:(rt=e==null?void 0:e.maxRetries)!=null?rt:(et=this._options)==null?void 0:et.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(Ou=this._options)==null?void 0:Ou.fetch,logging:this._options.logging});if(E.ok)return {data:Dm.parseOrThrow(E.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:E.rawResponse};if(E.error.reason==="status-code")throw E.error.statusCode===400?new D(E.error.body,E.rawResponse):new w({statusCode:E.error.statusCode,body:E.error.body,rawResponse:E.rawResponse});return A(E.error,E.rawResponse,"GET","/v1/private/experiments")}createExperiment(o,e){return _.fromPromise(this.__createExperiment(o,e))}async __createExperiment(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ht.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments")}createExperimentItems(o,e){return _.fromPromise(this.__createExperimentItems(o,e))}async __createExperimentItems(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/items"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Bt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments/items")}deleteExperimentItems(o,e){return _.fromPromise(this.__deleteExperimentItems(o,e))}async __deleteExperimentItems(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/items/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Vt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments/items/delete")}deleteExperimentsById(o,e){return _.fromPromise(this.__deleteExperimentsById(o,e))}async __deleteExperimentsById(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Hr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments/delete")}experimentItemsBulk(o,e){return _.fromPromise(this.__experimentItemsBulk(o,e))}async __experimentItemsBulk(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/items/bulk"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Nt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 409:throw new $(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"PUT","/v1/private/experiments/items/bulk")}findFeedbackScoreNames(o={},e){return _.fromPromise(this.__findFeedbackScoreNames(o,e))}async __findFeedbackScoreNames(o={},e){var p,l,c,d,m,f,u,h,g,x,T;let{experimentIds:t}=o,i={experiment_ids:t},a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=e==null?void 0:e.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),e==null?void 0:e.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,"v1/private/experiments/feedback-scores/names"),method:"GET",headers:a,queryParameters:{...i,...e==null?void 0:e.queryParams},timeoutMs:((h=(u=e==null?void 0:e.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=e==null?void 0:e.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:Dr.findFeedbackScoreNames.Response.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/experiments/feedback-scores/names")}findExperimentGroups(o={},e){return _.fromPromise(this.__findExperimentGroups(o,e))}async __findExperimentGroups(o={},e){var m,f,u,h,g,x,T,v,E,C,U;let{groups:t,types:i,name:a,projectId:s,filters:p}=o,l={groups:t,types:i,name:a,project_id:s,filters:p},c=z((m=this._options)==null?void 0:m.headers,P({"Comet-Workspace":(u=e==null?void 0:e.workspaceName)!=null?u:(f=this._options)==null?void 0:f.workspaceName}),e==null?void 0:e.headers),d=await k({url:R.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:S.Default,"v1/private/experiments/groups"),method:"GET",headers:c,queryParameters:{...l,...e==null?void 0:e.queryParams},timeoutMs:((v=(T=e==null?void 0:e.timeoutInSeconds)!=null?T:(x=this._options)==null?void 0:x.timeoutInSeconds)!=null?v:60)*1e3,maxRetries:(C=e==null?void 0:e.maxRetries)!=null?C:(E=this._options)==null?void 0:E.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(U=this._options)==null?void 0:U.fetch,logging:this._options.logging});if(d.ok)return {data:Pm.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")throw d.error.statusCode===400?new D(d.error.body,d.rawResponse):new w({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse});return A(d.error,d.rawResponse,"GET","/v1/private/experiments/groups")}findExperimentGroupsAggregations(o={},e){return _.fromPromise(this.__findExperimentGroupsAggregations(o,e))}async __findExperimentGroupsAggregations(o={},e){var m,f,u,h,g,x,T,v,E,C,U;let{groups:t,types:i,name:a,projectId:s,filters:p}=o,l={groups:t,types:i,name:a,project_id:s,filters:p},c=z((m=this._options)==null?void 0:m.headers,P({"Comet-Workspace":(u=e==null?void 0:e.workspaceName)!=null?u:(f=this._options)==null?void 0:f.workspaceName}),e==null?void 0:e.headers),d=await k({url:R.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:S.Default,"v1/private/experiments/groups/aggregations"),method:"GET",headers:c,queryParameters:{...l,...e==null?void 0:e.queryParams},timeoutMs:((v=(T=e==null?void 0:e.timeoutInSeconds)!=null?T:(x=this._options)==null?void 0:x.timeoutInSeconds)!=null?v:60)*1e3,maxRetries:(C=e==null?void 0:e.maxRetries)!=null?C:(E=this._options)==null?void 0:E.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(U=this._options)==null?void 0:U.fetch,logging:this._options.logging});if(d.ok)return {data:_m.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")throw d.error.statusCode===400?new D(d.error.body,d.rawResponse):new w({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse});return A(d.error,d.rawResponse,"GET","/v1/private/experiments/groups/aggregations")}finishExperiments(o,e){return _.fromPromise(this.__finishExperiments(o,e))}async __finishExperiments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/finish"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Hr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments/finish")}getExperimentById(o,e={},t){return _.fromPromise(this.__getExperimentById(o,e,t))}async __getExperimentById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/experiments/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:ti.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/experiments/{id}")}updateExperiment(o,e,t){return _.fromPromise(this.__updateExperiment(o,e,t))}async __updateExperiment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/experiments/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Dt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new D(s.error.body,s.rawResponse);case 404:throw new I(s.error.body,s.rawResponse);default:throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return A(s.error,s.rawResponse,"PATCH","/v1/private/experiments/{id}")}getExperimentItemById(o,e={},t){return _.fromPromise(this.__getExperimentItemById(o,e,t))}async __getExperimentItemById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/experiments/items/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:$o.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/experiments/items/{id}")}streamExperimentItems(o,e){return _.fromPromise(this.__streamExperimentItems(o,e))}async __streamExperimentItems(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/items/stream"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Mt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),responseType:"streaming",timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:i.body,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments/items/stream")}streamExperiments(o,e){return _.fromPromise(this.__streamExperiments(o,e))}async __streamExperiments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/experiments/stream"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Lt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),responseType:"streaming",timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:i.body,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/experiments/stream")}};var qa=class{constructor(o={}){this._options=F(o);}findFeedbackDefinitions(o={},e){return _.fromPromise(this.__findFeedbackDefinitions(o,e))}async __findFeedbackDefinitions(o={},e){var d,m,f,u,h,g,x,T,v,E,C;let{page:t,size:i,name:a,type:s}=o,p={page:t,size:i,name:a,type:s!=null?da.jsonOrThrow(s,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/private/feedback-definitions"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:Gm.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});return A(c.error,c.rawResponse,"GET","/v1/private/feedback-definitions")}createFeedbackDefinition(o,e){return _.fromPromise(this.__createFeedbackDefinition(o,e))}async __createFeedbackDefinition(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/feedback-definitions"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Vm.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/feedback-definitions")}getFeedbackDefinitionById(o,e={},t){return _.fromPromise(this.__getFeedbackDefinitionById(o,e,t))}async __getFeedbackDefinitionById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/feedback-definitions/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:$m.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/feedback-definitions/{id}")}updateFeedbackDefinition(o,e,t){return _.fromPromise(this.__updateFeedbackDefinition(o,e,t))}async __updateFeedbackDefinition(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/feedback-definitions/${R.encodePathParam(o)}`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ad.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PUT","/v1/private/feedback-definitions/{id}")}deleteFeedbackDefinitionById(o,e={},t){return _.fromPromise(this.__deleteFeedbackDefinitionById(o,e,t))}async __deleteFeedbackDefinitionById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/feedback-definitions/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===409?new $(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/feedback-definitions/{id}")}deleteFeedbackDefinitionsBatch(o,e){return _.fromPromise(this.__deleteFeedbackDefinitionsBatch(o,e))}async __deleteFeedbackDefinitionsBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/feedback-definitions/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===409?new $(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/feedback-definitions/delete")}};var en=class{constructor(o={}){this._options=F(o);}createGuardrails(o,e){return _.fromPromise(this.__createGuardrails(o,e))}async __createGuardrails(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/guardrails"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Jt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/guardrails")}};var rn=class{constructor(o={}){this._options=F(o);}deleteLlmProviderApiKeysBatch(o,e){return _.fromPromise(this.__deleteLlmProviderApiKeysBatch(o,e))}async __deleteLlmProviderApiKeysBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/llm-provider-key/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/llm-provider-key/delete")}findLlmProviderKeys(o){return _.fromPromise(this.__findLlmProviderKeys(o))}async __findLlmProviderKeys(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/llm-provider-key"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:bu.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/private/llm-provider-key")}storeLlmProviderApiKey(o,e){return _.fromPromise(this.__storeLlmProviderApiKey(o,e))}async __storeLlmProviderApiKey(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/llm-provider-key"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Kt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 401:throw new re(i.error.body,i.rawResponse);case 403:throw new ne(de.parseOrThrow(i.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/llm-provider-key")}getLlmProviderApiKeyById(o,e={},t){return _.fromPromise(this.__getLlmProviderApiKeyById(o,e,t))}async __getLlmProviderApiKeyById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/llm-provider-key/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:ci.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/llm-provider-key/{id}")}updateLlmProviderApiKey(o,e={},t){return _.fromPromise(this.__updateLlmProviderApiKey(o,e,t))}async __updateLlmProviderApiKey(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/llm-provider-key/${R.encodePathParam(o)}`),method:"PATCH",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Gt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 401:throw new re(a.error.body,a.rawResponse);case 403:throw new ne(de.parseOrThrow(a.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),a.rawResponse);case 404:throw new I(a.error.body,a.rawResponse);default:throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}return A(a.error,a.rawResponse,"PATCH","/v1/private/llm-provider-key/{id}")}};var tn=class{constructor(o={}){this._options=F(o);}evaluateSpans(o,e){return _.fromPromise(this.__evaluateSpans(o,e))}async __evaluateSpans(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/manual-evaluation/spans"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ai.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:ni.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 404:throw new I(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/manual-evaluation/spans")}evaluateThreads(o,e){return _.fromPromise(this.__evaluateThreads(o,e))}async __evaluateThreads(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/manual-evaluation/threads"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ai.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:ni.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 404:throw new I(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/manual-evaluation/threads")}evaluateTraces(o,e){return _.fromPromise(this.__evaluateTraces(o,e))}async __evaluateTraces(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/manual-evaluation/traces"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ai.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:ni.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 404:throw new I(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/manual-evaluation/traces")}};var on=class{constructor(o={}){this._options=F(o);}receiveProtobufTraces(o){return _.fromPromise(this.__receiveProtobufTraces(o))}async __receiveProtobufTraces(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/otel/v1/traces"),method:"POST",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:t.body,rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"POST","/v1/private/otel/v1/traces")}};var an=class{constructor(o={}){this._options=F(o);}cancelStudioOptimizations(o,e={},t){return _.fromPromise(this.__cancelStudioOptimizations(o,e,t))}async __cancelStudioOptimizations(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/optimizations/studio/${R.encodePathParam(o)}/cancel`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===501?new qe(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/optimizations/studio/{id}/cancel")}findOptimizations(o={},e){return _.fromPromise(this.__findOptimizations(o,e))}async __findOptimizations(o={},e){var f,u,h,g,x,T,v,E,C,U,M;let{page:t,size:i,datasetId:a,name:s,datasetDeleted:p,filters:l}=o,c={page:t,size:i,dataset_id:a,name:s,dataset_deleted:p,filters:l},d=z((f=this._options)==null?void 0:f.headers,P({"Comet-Workspace":(h=e==null?void 0:e.workspaceName)!=null?h:(u=this._options)==null?void 0:u.workspaceName}),e==null?void 0:e.headers),m=await k({url:R.join((x=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?x:S.Default,"v1/private/optimizations"),method:"GET",headers:d,queryParameters:{...c,...e==null?void 0:e.queryParams},timeoutMs:((E=(v=e==null?void 0:e.timeoutInSeconds)!=null?v:(T=this._options)==null?void 0:T.timeoutInSeconds)!=null?E:60)*1e3,maxRetries:(U=e==null?void 0:e.maxRetries)!=null?U:(C=this._options)==null?void 0:C.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(M=this._options)==null?void 0:M.fetch,logging:this._options.logging});if(m.ok)return {data:jd.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")throw m.error.statusCode===400?new D(m.error.body,m.rawResponse):new w({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse});return A(m.error,m.rawResponse,"GET","/v1/private/optimizations")}createOptimization(o,e){return _.fromPromise(this.__createOptimization(o,e))}async __createOptimization(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/optimizations"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Va.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/optimizations")}upsertOptimization(o,e){return _.fromPromise(this.__upsertOptimization(o,e))}async __upsertOptimization(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/optimizations"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Va.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/optimizations")}deleteOptimizationsById(o,e){return _.fromPromise(this.__deleteOptimizationsById(o,e))}async __deleteOptimizationsById(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/optimizations/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Hr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/optimizations/delete")}getOptimizationById(o,e={},t){return _.fromPromise(this.__getOptimizationById(o,e,t))}async __getOptimizationById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/optimizations/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:si.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/optimizations/{id}")}updateOptimizationsById(o,e={},t){return _.fromPromise(this.__updateOptimizationsById(o,e,t))}async __updateOptimizationsById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/optimizations/${R.encodePathParam(o)}`),method:"PUT",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:$t.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"PUT","/v1/private/optimizations/{id}")}getStudioOptimizationLogs(o,e={},t){return _.fromPromise(this.__getStudioOptimizationLogs(o,e,t))}async __getStudioOptimizationLogs(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/optimizations/studio/${R.encodePathParam(o)}/logs`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Md.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/optimizations/studio/{id}/logs")}};var nn=class{constructor(o={}){this._options=F(o);}findProjects(o={},e){return _.fromPromise(this.__findProjects(o,e))}async __findProjects(o={},e){var d,m,f,u,h,g,x,T,v,E,C;let{page:t,size:i,name:a,sorting:s}=o,p={page:t,size:i,name:a,sorting:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/private/projects"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:Zd.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});return A(c.error,c.rawResponse,"GET","/v1/private/projects")}createProject(o,e){return _.fromPromise(this.__createProject(o,e))}async __createProject(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/projects"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Zt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/projects")}getProjectById(o,e={},t){return _.fromPromise(this.__getProjectById(o,e,t))}async __getProjectById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/projects/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:pi.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/projects/{id}")}deleteProjectById(o,e={},t){return _.fromPromise(this.__deleteProjectById(o,e,t))}async __deleteProjectById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/projects/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===409?new $(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/projects/{id}")}updateProject(o,e={},t){return _.fromPromise(this.__updateProject(o,e,t))}async __updateProject(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/projects/${R.encodePathParam(o)}`),method:"PATCH",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Xt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new D(a.error.body,a.rawResponse);case 422:throw new Z(a.error.body,a.rawResponse);default:throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}return A(a.error,a.rawResponse,"PATCH","/v1/private/projects/{id}")}deleteProjectsBatch(o,e){return _.fromPromise(this.__deleteProjectsBatch(o,e))}async __deleteProjectsBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/projects/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/projects/delete")}findFeedbackScoreNamesByProjectIds(o={},e){return _.fromPromise(this.__findFeedbackScoreNamesByProjectIds(o,e))}async __findFeedbackScoreNamesByProjectIds(o={},e){var p,l,c,d,m,f,u,h,g,x,T;let{projectIds:t}=o,i={project_ids:t},a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=e==null?void 0:e.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),e==null?void 0:e.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,"v1/private/projects/feedback-scores/names"),method:"GET",headers:a,queryParameters:{...i,...e==null?void 0:e.queryParams},timeoutMs:((h=(u=e==null?void 0:e.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=e==null?void 0:e.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:Om.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/projects/feedback-scores/names")}getProjectMetrics(o,e={},t){return _.fromPromise(this.__getProjectMetrics(o,e,t))}async __getProjectMetrics(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/projects/${R.encodePathParam(o)}/metrics`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Qt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Yd.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new D(a.error.body,a.rawResponse);case 404:throw new I(a.error.body,a.rawResponse);default:throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}return A(a.error,a.rawResponse,"POST","/v1/private/projects/{id}/metrics")}getProjectStats(o={},e){return _.fromPromise(this.__getProjectStats(o,e))}async __getProjectStats(o={},e){var d,m,f,u,h,g,x,T,v,E,C;let{page:t,size:i,name:a,sorting:s}=o,p={page:t,size:i,name:a,sorting:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/private/projects/stats"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:ru.parseOrThrow(c.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:c.rawResponse};if(c.error.reason==="status-code")throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse});return A(c.error,c.rawResponse,"GET","/v1/private/projects/stats")}retrieveProject(o,e){return _.fromPromise(this.__retrieveProject(o,e))}async __retrieveProject(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/projects/retrieve"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Yt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Gd.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 404:throw new I(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/projects/retrieve")}};var sn=class{constructor(o={}){this._options=F(o);}getPrompts(o={},e){return _.fromPromise(this.__getPrompts(o,e))}async __getPrompts(o={},e){var m,f,u,h,g,x,T,v,E,C,U;let{page:t,size:i,name:a,sorting:s,filters:p}=o,l={page:t,size:i,name:a,sorting:s,filters:p},c=z((m=this._options)==null?void 0:m.headers,P({"Comet-Workspace":(u=e==null?void 0:e.workspaceName)!=null?u:(f=this._options)==null?void 0:f.workspaceName}),e==null?void 0:e.headers),d=await k({url:R.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:S.Default,"v1/private/prompts"),method:"GET",headers:c,queryParameters:{...l,...e==null?void 0:e.queryParams},timeoutMs:((v=(T=e==null?void 0:e.timeoutInSeconds)!=null?T:(x=this._options)==null?void 0:x.timeoutInSeconds)!=null?v:60)*1e3,maxRetries:(C=e==null?void 0:e.maxRetries)!=null?C:(E=this._options)==null?void 0:E.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(U=this._options)==null?void 0:U.fetch,logging:this._options.logging});if(d.ok)return {data:mu.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")throw new w({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse});return A(d.error,d.rawResponse,"GET","/v1/private/prompts")}createPrompt(o,e){return _.fromPromise(this.__createPrompt(o,e))}async __createPrompt(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/prompts"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:to.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 409:throw new $(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/prompts")}createPromptVersion(o,e){return _.fromPromise(this.__createPromptVersion(o,e))}async __createPromptVersion(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/prompts/versions"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ot.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Ee.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 409:throw new $(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/prompts/versions")}updatePromptVersions(o,e){return _.fromPromise(this.__updatePromptVersions(o,e))}async __updatePromptVersions(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/prompts/versions"),method:"PATCH",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:eo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PATCH","/v1/private/prompts/versions")}getPromptById(o,e={},t){return _.fromPromise(this.__getPromptById(o,e,t))}async __getPromptById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/prompts/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:pu.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/prompts/{id}")}updatePrompt(o,e,t){return _.fromPromise(this.__updatePrompt(o,e,t))}async __updatePrompt(o,e,t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/prompts/${R.encodePathParam(o)}`),method:"PUT",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:qt.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new D(a.error.body,a.rawResponse);case 404:throw new I(a.error.body,a.rawResponse);case 409:throw new $(a.error.body,a.rawResponse);case 422:throw new Z(a.error.body,a.rawResponse);default:throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}return A(a.error,a.rawResponse,"PUT","/v1/private/prompts/{id}")}deletePrompt(o,e={},t){return _.fromPromise(this.__deletePrompt(o,e,t))}async __deletePrompt(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/prompts/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/prompts/{id}")}deletePromptsBatch(o,e){return _.fromPromise(this.__deletePromptsBatch(o,e))}async __deletePromptsBatch(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/prompts/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/prompts/delete")}getPromptVersionById(o,e={},t){return _.fromPromise(this.__getPromptVersionById(o,e,t))}async __getPromptVersionById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/prompts/versions/${R.encodePathParam(o)}`),method:"GET",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:Ee.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===404?new I(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"GET","/v1/private/prompts/versions/{versionId}")}getPromptVersions(o,e={},t){return _.fromPromise(this.__getPromptVersions(o,e,t))}async __getPromptVersions(o,e={},t){var f,u,h,g,x,T,v,E,C,U,M;let{page:i,size:a,search:s,sorting:p,filters:l}=e,c={page:i,size:a,search:s,sorting:p,filters:l},d=z((f=this._options)==null?void 0:f.headers,P({"Comet-Workspace":(h=t==null?void 0:t.workspaceName)!=null?h:(u=this._options)==null?void 0:u.workspaceName}),t==null?void 0:t.headers),m=await k({url:R.join((x=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?x:S.Default,`v1/private/prompts/${R.encodePathParam(o)}/versions`),method:"GET",headers:d,queryParameters:{...c,...t==null?void 0:t.queryParams},timeoutMs:((E=(v=t==null?void 0:t.timeoutInSeconds)!=null?v:(T=this._options)==null?void 0:T.timeoutInSeconds)!=null?E:60)*1e3,maxRetries:(U=t==null?void 0:t.maxRetries)!=null?U:(C=this._options)==null?void 0:C.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(M=this._options)==null?void 0:M.fetch,logging:this._options.logging});if(m.ok)return {data:hu.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")throw new w({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse});return A(m.error,m.rawResponse,"GET","/v1/private/prompts/{id}/versions")}restorePromptVersion(o,e,t={},i){return _.fromPromise(this.__restorePromptVersion(o,e,t,i))}async __restorePromptVersion(o,e,t={},i){var p,l,c,d,m,f,u,h,g,x,T;let a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=i==null?void 0:i.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),i==null?void 0:i.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/prompts/${R.encodePathParam(o)}/versions/${R.encodePathParam(e)}/restore`),method:"POST",headers:a,queryParameters:i==null?void 0:i.queryParams,timeoutMs:((h=(u=i==null?void 0:i.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=i==null?void 0:i.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:i==null?void 0:i.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:Ee.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new D(s.error.body,s.rawResponse);case 404:throw new I(s.error.body,s.rawResponse);default:throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return A(s.error,s.rawResponse,"POST","/v1/private/prompts/{promptId}/versions/{versionId}/restore")}retrievePromptVersion(o,e){return _.fromPromise(this.__retrievePromptVersion(o,e))}async __retrievePromptVersion(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/prompts/versions/retrieve"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ro.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Ee.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 404:throw new I(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/prompts/versions/retrieve")}};var pn=class{constructor(o={}){this._options=F(o);}datasetsRedirect(o,e){return _.fromPromise(this.__datasetsRedirect(o,e))}async __datasetsRedirect(o,e){var c,d,m,f,u,h,g,x,T,v,E;let{datasetId:t,workspaceName:i,path:a}=o,s={dataset_id:t,workspace_name:i,path:a},p=z((c=this._options)==null?void 0:c.headers,P({"Comet-Workspace":(m=e==null?void 0:e.workspaceName)!=null?m:(d=this._options)==null?void 0:d.workspaceName}),e==null?void 0:e.headers),l=await k({url:R.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:S.Default,"v1/session/redirect/datasets"),method:"GET",headers:p,queryParameters:{...s,...e==null?void 0:e.queryParams},timeoutMs:((x=(g=e==null?void 0:e.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?x:60)*1e3,maxRetries:(v=e==null?void 0:e.maxRetries)!=null?v:(T=this._options)==null?void 0:T.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(E=this._options)==null?void 0:E.fetch,logging:this._options.logging});if(l.ok)return {data:void 0,rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new D(l.error.body,l.rawResponse);case 404:throw new I(l.error.body,l.rawResponse);default:throw new w({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return A(l.error,l.rawResponse,"GET","/v1/session/redirect/datasets")}experimentsRedirect(o,e){return _.fromPromise(this.__experimentsRedirect(o,e))}async __experimentsRedirect(o,e){var d,m,f,u,h,g,x,T,v,E,C;let{datasetId:t,experimentId:i,workspaceName:a,path:s}=o,p={dataset_id:t,experiment_id:i,workspace_name:a,path:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/session/redirect/experiments"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:void 0,rawResponse:c.rawResponse};if(c.error.reason==="status-code")switch(c.error.statusCode){case 400:throw new D(c.error.body,c.rawResponse);case 404:throw new I(c.error.body,c.rawResponse);default:throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse})}return A(c.error,c.rawResponse,"GET","/v1/session/redirect/experiments")}optimizationsRedirect(o,e){return _.fromPromise(this.__optimizationsRedirect(o,e))}async __optimizationsRedirect(o,e){var d,m,f,u,h,g,x,T,v,E,C;let{datasetId:t,optimizationId:i,workspaceName:a,path:s}=o,p={dataset_id:t,optimization_id:i,workspace_name:a,path:s},l=z((d=this._options)==null?void 0:d.headers,P({"Comet-Workspace":(f=e==null?void 0:e.workspaceName)!=null?f:(m=this._options)==null?void 0:m.workspaceName}),e==null?void 0:e.headers),c=await k({url:R.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:S.Default,"v1/session/redirect/optimizations"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(x=e==null?void 0:e.timeoutInSeconds)!=null?x:(g=this._options)==null?void 0:g.timeoutInSeconds)!=null?T:60)*1e3,maxRetries:(E=e==null?void 0:e.maxRetries)!=null?E:(v=this._options)==null?void 0:v.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(C=this._options)==null?void 0:C.fetch,logging:this._options.logging});if(c.ok)return {data:void 0,rawResponse:c.rawResponse};if(c.error.reason==="status-code")switch(c.error.statusCode){case 400:throw new D(c.error.body,c.rawResponse);case 404:throw new I(c.error.body,c.rawResponse);default:throw new w({statusCode:c.error.statusCode,body:c.error.body,rawResponse:c.rawResponse})}return A(c.error,c.rawResponse,"GET","/v1/session/redirect/optimizations")}projectsRedirect(o,e){return _.fromPromise(this.__projectsRedirect(o,e))}async __projectsRedirect(o,e){var c,d,m,f,u,h,g,x,T,v,E;let{traceId:t,workspaceName:i,path:a}=o,s={trace_id:t,workspace_name:i,path:a},p=z((c=this._options)==null?void 0:c.headers,P({"Comet-Workspace":(m=e==null?void 0:e.workspaceName)!=null?m:(d=this._options)==null?void 0:d.workspaceName}),e==null?void 0:e.headers),l=await k({url:R.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:S.Default,"v1/session/redirect/projects"),method:"GET",headers:p,queryParameters:{...s,...e==null?void 0:e.queryParams},timeoutMs:((x=(g=e==null?void 0:e.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?x:60)*1e3,maxRetries:(v=e==null?void 0:e.maxRetries)!=null?v:(T=this._options)==null?void 0:T.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(E=this._options)==null?void 0:E.fetch,logging:this._options.logging});if(l.ok)return {data:void 0,rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new D(l.error.body,l.rawResponse);case 404:throw new I(l.error.body,l.rawResponse);default:throw new w({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return A(l.error,l.rawResponse,"GET","/v1/session/redirect/projects")}};var cn=class{constructor(o={}){this._options=F(o);}getServiceToggles(o){return _.fromPromise(this.__getServiceToggles(o))}async __getServiceToggles(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/toggles"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:xu.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/private/toggles")}};var ln=class{constructor(o={}){this._options=F(o);}addSpanComment(o,e,t){return _.fromPromise(this.__addSpanComment(o,e,t))}async __addSpanComment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/spans/${R.encodePathParam(o)}/comments`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:O.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/spans/{id}/comments")}addSpanFeedbackScore(o,e,t){return _.fromPromise(this.__addSpanFeedbackScore(o,e,t))}async __addSpanFeedbackScore(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/spans/${R.encodePathParam(o)}/feedback-scores`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:se.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PUT","/v1/private/spans/{id}/feedback-scores")}createSpans(o,e){return _.fromPromise(this.__createSpans(o,e))}async __createSpans(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/spans/batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:so.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/spans/batch")}batchUpdateSpans(o,e){return _.fromPromise(this.__batchUpdateSpans(o,e))}async __batchUpdateSpans(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/spans/batch"),method:"PATCH",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:io.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PATCH","/v1/private/spans/batch")}getSpansByProject(o={},e){return _.fromPromise(this.__getSpansByProject(o,e))}async __getSpansByProject(o={},e){var E,C,U,M,X,ie,ze,ke,Ve,et,rt;let{page:t,size:i,projectName:a,projectId:s,traceId:p,type:l,filters:c,truncate:d,stripAttachments:m,sorting:f,exclude:u,fromTime:h,toTime:g}=o,x={page:t,size:i,project_name:a,project_id:s,trace_id:p,type:l!=null?Ca.jsonOrThrow(l,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0,filters:c,truncate:d,strip_attachments:m,sorting:f,exclude:u,from_time:h==null?void 0:h.toISOString(),to_time:g==null?void 0:g.toISOString()},T=z((E=this._options)==null?void 0:E.headers,P({"Comet-Workspace":(U=e==null?void 0:e.workspaceName)!=null?U:(C=this._options)==null?void 0:C.workspaceName}),e==null?void 0:e.headers),v=await k({url:R.join((X=(M=await b.get(this._options.baseUrl))!=null?M:await b.get(this._options.environment))!=null?X:S.Default,"v1/private/spans"),method:"GET",headers:T,queryParameters:{...x,...e==null?void 0:e.queryParams},timeoutMs:((ke=(ze=e==null?void 0:e.timeoutInSeconds)!=null?ze:(ie=this._options)==null?void 0:ie.timeoutInSeconds)!=null?ke:60)*1e3,maxRetries:(et=e==null?void 0:e.maxRetries)!=null?et:(Ve=this._options)==null?void 0:Ve.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(rt=this._options)==null?void 0:rt.fetch,logging:this._options.logging});if(v.ok)return {data:wu.parseOrThrow(v.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:v.rawResponse};if(v.error.reason==="status-code")throw new w({statusCode:v.error.statusCode,body:v.error.body,rawResponse:v.rawResponse});return A(v.error,v.rawResponse,"GET","/v1/private/spans")}createSpan(o,e){return _.fromPromise(this.__createSpan(o,e))}async __createSpan(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/spans"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:no.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===409?new $(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/spans")}getSpanById(o,e={},t){return _.fromPromise(this.__getSpanById(o,e,t))}async __getSpanById(o,e={},t){var l,c,d,m,f,u,h,g,x,T,v;let{stripAttachments:i}=e,a={strip_attachments:i},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=t==null?void 0:t.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),t==null?void 0:t.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,`v1/private/spans/${R.encodePathParam(o)}`),method:"GET",headers:s,queryParameters:{...a,...t==null?void 0:t.queryParams},timeoutMs:((g=(h=t==null?void 0:t.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=t==null?void 0:t.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:li.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw p.error.statusCode===404?new I(p.error.body,p.rawResponse):new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"GET","/v1/private/spans/{id}")}deleteSpanById(o,e={},t){return _.fromPromise(this.__deleteSpanById(o,e,t))}async __deleteSpanById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/spans/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw a.error.statusCode===501?new qe(a.error.body,a.rawResponse):new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/spans/{id}")}updateSpan(o,e,t){return _.fromPromise(this.__updateSpan(o,e,t))}async __updateSpan(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/spans/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:oo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/spans/{id}")}deleteSpanComments(o,e){return _.fromPromise(this.__deleteSpanComments(o,e))}async __deleteSpanComments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/spans/comments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/spans/comments/delete")}deleteSpanFeedbackScore(o,e,t){return _.fromPromise(this.__deleteSpanFeedbackScore(o,e,t))}async __deleteSpanFeedbackScore(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/spans/${R.encodePathParam(o)}/feedback-scores/delete`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Xo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/spans/{id}/feedback-scores/delete")}findFeedbackScoreNames1(o={},e){return _.fromPromise(this.__findFeedbackScoreNames1(o,e))}async __findFeedbackScoreNames1(o={},e){var l,c,d,m,f,u,h,g,x,T,v;let{projectId:t,type:i}=o,a={project_id:t,type:i!=null?ja.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=e==null?void 0:e.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),e==null?void 0:e.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,"v1/private/spans/feedback-scores/names"),method:"GET",headers:s,queryParameters:{...a,...e==null?void 0:e.queryParams},timeoutMs:((g=(h=e==null?void 0:e.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=e==null?void 0:e.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:Ur.findFeedbackScoreNames1.Response.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"GET","/v1/private/spans/feedback-scores/names")}getSpanComment(o,e,t={},i){return _.fromPromise(this.__getSpanComment(o,e,t,i))}async __getSpanComment(o,e,t={},i){var p,l,c,d,m,f,u,h,g,x,T;let a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=i==null?void 0:i.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),i==null?void 0:i.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/spans/${R.encodePathParam(o)}/comments/${R.encodePathParam(e)}`),method:"GET",headers:a,queryParameters:i==null?void 0:i.queryParams,timeoutMs:((h=(u=i==null?void 0:i.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=i==null?void 0:i.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:i==null?void 0:i.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:O.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/spans/{spanId}/comments/{commentId}")}getSpanStats(o={},e){return _.fromPromise(this.__getSpanStats(o,e))}async __getSpanStats(o={},e){var u,h,g,x,T,v,E,C,U,M,X;let{projectId:t,projectName:i,traceId:a,type:s,filters:p,fromTime:l,toTime:c}=o,d={project_id:t,project_name:i,trace_id:a,type:s!=null?Ea.jsonOrThrow(s,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0,filters:p,from_time:l==null?void 0:l.toISOString(),to_time:c==null?void 0:c.toISOString()},m=z((u=this._options)==null?void 0:u.headers,P({"Comet-Workspace":(g=e==null?void 0:e.workspaceName)!=null?g:(h=this._options)==null?void 0:h.workspaceName}),e==null?void 0:e.headers),f=await k({url:R.join((T=(x=await b.get(this._options.baseUrl))!=null?x:await b.get(this._options.environment))!=null?T:S.Default,"v1/private/spans/stats"),method:"GET",headers:m,queryParameters:{...d,...e==null?void 0:e.queryParams},timeoutMs:((C=(E=e==null?void 0:e.timeoutInSeconds)!=null?E:(v=this._options)==null?void 0:v.timeoutInSeconds)!=null?C:60)*1e3,maxRetries:(M=e==null?void 0:e.maxRetries)!=null?M:(U=this._options)==null?void 0:U.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(X=this._options)==null?void 0:X.fetch,logging:this._options.logging});if(f.ok)return {data:Je.parseOrThrow(f.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:f.rawResponse};if(f.error.reason==="status-code")throw new w({statusCode:f.error.statusCode,body:f.error.body,rawResponse:f.rawResponse});return A(f.error,f.rawResponse,"GET","/v1/private/spans/stats")}scoreBatchOfSpans(o,e){return _.fromPromise(this.__scoreBatchOfSpans(o,e))}async __scoreBatchOfSpans(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/spans/feedback-scores"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ii.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/spans/feedback-scores")}searchSpans(o={},e){return _.fromPromise(this.__searchSpans(o,e))}async __searchSpans(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/spans/search"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:po.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),responseType:"streaming",timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:i.body,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/spans/search")}updateSpanComment(o,e,t){return _.fromPromise(this.__updateSpanComment(o,e,t))}async __updateSpanComment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/spans/comments/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:O.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/spans/comments/{commentId}")}};var mn=class{constructor(o={}){this._options=F(o);}getDatasetBiInfo(o){return _.fromPromise(this.__getDatasetBiInfo(o))}async __getDatasetBiInfo(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/internal/usage/bi-datasets"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Vr.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/internal/usage/bi-datasets")}getExperimentBiInfo(o){return _.fromPromise(this.__getExperimentBiInfo(o))}async __getExperimentBiInfo(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/internal/usage/bi-experiments"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Vr.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/internal/usage/bi-experiments")}getSpansBiInfo(o){return _.fromPromise(this.__getSpansBiInfo(o))}async __getSpansBiInfo(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/internal/usage/bi-spans"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Vr.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/internal/usage/bi-spans")}getSpansCountForWorkspaces(o){return _.fromPromise(this.__getSpansCountForWorkspaces(o))}async __getSpansCountForWorkspaces(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/internal/usage/workspace-span-counts"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:zu.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/internal/usage/workspace-span-counts")}getTracesBiInfo(o){return _.fromPromise(this.__getTracesBiInfo(o))}async __getTracesBiInfo(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/internal/usage/bi-traces"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Vr.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/internal/usage/bi-traces")}getTracesCountForWorkspaces(o){return _.fromPromise(this.__getTracesCountForWorkspaces(o))}async __getTracesCountForWorkspaces(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/internal/usage/workspace-trace-counts"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Pu.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/internal/usage/workspace-trace-counts")}};var dn=class{constructor(o={}){this._options=F(o);}addThreadComment(o,e,t){return _.fromPromise(this.__addThreadComment(o,e,t))}async __addThreadComment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/threads/${R.encodePathParam(o)}/comments`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:O.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/traces/threads/{id}/comments")}addTraceComment(o,e,t){return _.fromPromise(this.__addTraceComment(o,e,t))}async __addTraceComment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/${R.encodePathParam(o)}/comments`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:O.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/traces/{id}/comments")}addTraceFeedbackScore(o,e,t){return _.fromPromise(this.__addTraceFeedbackScore(o,e,t))}async __addTraceFeedbackScore(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/${R.encodePathParam(o)}/feedback-scores`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:se.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PUT","/v1/private/traces/{id}/feedback-scores")}createTraces(o,e){return _.fromPromise(this.__createTraces(o,e))}async __createTraces(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:go.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/batch")}batchUpdateTraces(o,e){return _.fromPromise(this.__batchUpdateTraces(o,e))}async __batchUpdateTraces(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/batch"),method:"PATCH",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:fo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PATCH","/v1/private/traces/batch")}batchUpdateThreads(o,e){return _.fromPromise(this.__batchUpdateThreads(o,e))}async __batchUpdateThreads(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/batch"),method:"PATCH",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ro.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PATCH","/v1/private/traces/threads/batch")}closeTraceThread(o={},e){return _.fromPromise(this.__closeTraceThread(o,e))}async __closeTraceThread(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/close"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:bo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===404?new I(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/traces/threads/close")}getTracesByProject(o={},e){return _.fromPromise(this.__getTracesByProject(o,e))}async __getTracesByProject(o={},e){var T,v,E,C,U,M,X,ie,ze,ke,Ve;let{page:t,size:i,projectName:a,projectId:s,filters:p,truncate:l,stripAttachments:c,sorting:d,exclude:m,fromTime:f,toTime:u}=o,h={page:t,size:i,project_name:a,project_id:s,filters:p,truncate:l,strip_attachments:c,sorting:d,exclude:m,from_time:f==null?void 0:f.toISOString(),to_time:u==null?void 0:u.toISOString()},g=z((T=this._options)==null?void 0:T.headers,P({"Comet-Workspace":(E=e==null?void 0:e.workspaceName)!=null?E:(v=this._options)==null?void 0:v.workspaceName}),e==null?void 0:e.headers),x=await k({url:R.join((U=(C=await b.get(this._options.baseUrl))!=null?C:await b.get(this._options.environment))!=null?U:S.Default,"v1/private/traces"),method:"GET",headers:g,queryParameters:{...h,...e==null?void 0:e.queryParams},timeoutMs:((ie=(X=e==null?void 0:e.timeoutInSeconds)!=null?X:(M=this._options)==null?void 0:M.timeoutInSeconds)!=null?ie:60)*1e3,maxRetries:(ke=e==null?void 0:e.maxRetries)!=null?ke:(ze=this._options)==null?void 0:ze.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(Ve=this._options)==null?void 0:Ve.fetch,logging:this._options.logging});if(x.ok)return {data:Tu.parseOrThrow(x.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:x.rawResponse};if(x.error.reason==="status-code")throw new w({statusCode:x.error.statusCode,body:x.error.body,rawResponse:x.rawResponse});return A(x.error,x.rawResponse,"GET","/v1/private/traces")}createTrace(o,e){return _.fromPromise(this.__createTrace(o,e))}async __createTrace(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ho.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces")}getTraceById(o,e={},t){return _.fromPromise(this.__getTraceById(o,e,t))}async __getTraceById(o,e={},t){var l,c,d,m,f,u,h,g,x,T,v;let{stripAttachments:i}=e,a={strip_attachments:i},s=z((l=this._options)==null?void 0:l.headers,P({"Comet-Workspace":(d=t==null?void 0:t.workspaceName)!=null?d:(c=this._options)==null?void 0:c.workspaceName}),t==null?void 0:t.headers),p=await k({url:R.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:S.Default,`v1/private/traces/${R.encodePathParam(o)}`),method:"GET",headers:s,queryParameters:{...a,...t==null?void 0:t.queryParams},timeoutMs:((g=(h=t==null?void 0:t.timeoutInSeconds)!=null?h:(u=this._options)==null?void 0:u.timeoutInSeconds)!=null?g:60)*1e3,maxRetries:(T=t==null?void 0:t.maxRetries)!=null?T:(x=this._options)==null?void 0:x.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(v=this._options)==null?void 0:v.fetch,logging:this._options.logging});if(p.ok)return {data:mi.parseOrThrow(p.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:p.rawResponse};if(p.error.reason==="status-code")throw new w({statusCode:p.error.statusCode,body:p.error.body,rawResponse:p.rawResponse});return A(p.error,p.rawResponse,"GET","/v1/private/traces/{id}")}deleteTraceById(o,e={},t){return _.fromPromise(this.__deleteTraceById(o,e,t))}async __deleteTraceById(o,e={},t){var s,p,l,c,d,m,f,u,h,g,x;let i=z((s=this._options)==null?void 0:s.headers,P({"Comet-Workspace":(l=t==null?void 0:t.workspaceName)!=null?l:(p=this._options)==null?void 0:p.workspaceName}),t==null?void 0:t.headers),a=await k({url:R.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:S.Default,`v1/private/traces/${R.encodePathParam(o)}`),method:"DELETE",headers:i,queryParameters:t==null?void 0:t.queryParams,timeoutMs:((u=(f=t==null?void 0:t.timeoutInSeconds)!=null?f:(m=this._options)==null?void 0:m.timeoutInSeconds)!=null?u:60)*1e3,maxRetries:(g=t==null?void 0:t.maxRetries)!=null?g:(h=this._options)==null?void 0:h.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(x=this._options)==null?void 0:x.fetch,logging:this._options.logging});if(a.ok)return {data:void 0,rawResponse:a.rawResponse};if(a.error.reason==="status-code")throw new w({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse});return A(a.error,a.rawResponse,"DELETE","/v1/private/traces/{id}")}updateTrace(o,e,t){return _.fromPromise(this.__updateTrace(o,e,t))}async __updateTrace(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:uo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/traces/{id}")}deleteThreadComments(o,e){return _.fromPromise(this.__deleteThreadComments(o,e))}async __deleteThreadComments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/comments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/threads/comments/delete")}deleteThreadFeedbackScores(o,e){return _.fromPromise(this.__deleteThreadFeedbackScores(o,e))}async __deleteThreadFeedbackScores(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/feedback-scores/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:co.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/threads/feedback-scores/delete")}deleteTraceComments(o,e){return _.fromPromise(this.__deleteTraceComments(o,e))}async __deleteTraceComments(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/comments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/comments/delete")}deleteTraceFeedbackScore(o,e,t){return _.fromPromise(this.__deleteTraceFeedbackScore(o,e,t))}async __deleteTraceFeedbackScore(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/${R.encodePathParam(o)}/feedback-scores/delete`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Xo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"POST","/v1/private/traces/{id}/feedback-scores/delete")}deleteTraceThreads(o,e){return _.fromPromise(this.__deleteTraceThreads(o,e))}async __deleteTraceThreads(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:lo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/threads/delete")}deleteTraces(o,e){return _.fromPromise(this.__deleteTraces(o,e))}async __deleteTraces(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Y.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/delete")}findFeedbackScoreNames2(o={},e){return _.fromPromise(this.__findFeedbackScoreNames2(o,e))}async __findFeedbackScoreNames2(o={},e){var p,l,c,d,m,f,u,h,g,x,T;let{projectId:t}=o,i={project_id:t},a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=e==null?void 0:e.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),e==null?void 0:e.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,"v1/private/traces/feedback-scores/names"),method:"GET",headers:a,queryParameters:{...i,...e==null?void 0:e.queryParams},timeoutMs:((h=(u=e==null?void 0:e.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=e==null?void 0:e.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:ar.findFeedbackScoreNames2.Response.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/traces/feedback-scores/names")}findTraceThreadsFeedbackScoreNames(o={},e){return _.fromPromise(this.__findTraceThreadsFeedbackScoreNames(o,e))}async __findTraceThreadsFeedbackScoreNames(o={},e){var p,l,c,d,m,f,u,h,g,x,T;let{projectId:t}=o,i={project_id:t},a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=e==null?void 0:e.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),e==null?void 0:e.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,"v1/private/traces/threads/feedback-scores/names"),method:"GET",headers:a,queryParameters:{...i,...e==null?void 0:e.queryParams},timeoutMs:((h=(u=e==null?void 0:e.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=e==null?void 0:e.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:ar.findTraceThreadsFeedbackScoreNames.Response.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/traces/threads/feedback-scores/names")}getTraceStats(o={},e){return _.fromPromise(this.__getTraceStats(o,e))}async __getTraceStats(o={},e){var m,f,u,h,g,x,T,v,E,C,U;let{projectId:t,projectName:i,filters:a,fromTime:s,toTime:p}=o,l={project_id:t,project_name:i,filters:a,from_time:s==null?void 0:s.toISOString(),to_time:p==null?void 0:p.toISOString()},c=z((m=this._options)==null?void 0:m.headers,P({"Comet-Workspace":(u=e==null?void 0:e.workspaceName)!=null?u:(f=this._options)==null?void 0:f.workspaceName}),e==null?void 0:e.headers),d=await k({url:R.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:S.Default,"v1/private/traces/stats"),method:"GET",headers:c,queryParameters:{...l,...e==null?void 0:e.queryParams},timeoutMs:((v=(T=e==null?void 0:e.timeoutInSeconds)!=null?T:(x=this._options)==null?void 0:x.timeoutInSeconds)!=null?v:60)*1e3,maxRetries:(C=e==null?void 0:e.maxRetries)!=null?C:(E=this._options)==null?void 0:E.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(U=this._options)==null?void 0:U.fetch,logging:this._options.logging});if(d.ok)return {data:Je.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")throw new w({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse});return A(d.error,d.rawResponse,"GET","/v1/private/traces/stats")}getThreadComment(o,e,t={},i){return _.fromPromise(this.__getThreadComment(o,e,t,i))}async __getThreadComment(o,e,t={},i){var p,l,c,d,m,f,u,h,g,x,T;let a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=i==null?void 0:i.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),i==null?void 0:i.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/threads/${R.encodePathParam(o)}/comments/${R.encodePathParam(e)}`),method:"GET",headers:a,queryParameters:i==null?void 0:i.queryParams,timeoutMs:((h=(u=i==null?void 0:i.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=i==null?void 0:i.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:i==null?void 0:i.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:O.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/traces/threads/{threadId}/comments/{commentId}")}getTraceThreadStats(o={},e){return _.fromPromise(this.__getTraceThreadStats(o,e))}async __getTraceThreadStats(o={},e){var m,f,u,h,g,x,T,v,E,C,U;let{projectId:t,projectName:i,filters:a,fromTime:s,toTime:p}=o,l={project_id:t,project_name:i,filters:a,from_time:s==null?void 0:s.toISOString(),to_time:p==null?void 0:p.toISOString()},c=z((m=this._options)==null?void 0:m.headers,P({"Comet-Workspace":(u=e==null?void 0:e.workspaceName)!=null?u:(f=this._options)==null?void 0:f.workspaceName}),e==null?void 0:e.headers),d=await k({url:R.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:S.Default,"v1/private/traces/threads/stats"),method:"GET",headers:c,queryParameters:{...l,...e==null?void 0:e.queryParams},timeoutMs:((v=(T=e==null?void 0:e.timeoutInSeconds)!=null?T:(x=this._options)==null?void 0:x.timeoutInSeconds)!=null?v:60)*1e3,maxRetries:(C=e==null?void 0:e.maxRetries)!=null?C:(E=this._options)==null?void 0:E.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(U=this._options)==null?void 0:U.fetch,logging:this._options.logging});if(d.ok)return {data:Je.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")throw new w({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse});return A(d.error,d.rawResponse,"GET","/v1/private/traces/threads/stats")}getTraceComment(o,e,t={},i){return _.fromPromise(this.__getTraceComment(o,e,t,i))}async __getTraceComment(o,e,t={},i){var p,l,c,d,m,f,u,h,g,x,T;let a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=i==null?void 0:i.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),i==null?void 0:i.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/${R.encodePathParam(o)}/comments/${R.encodePathParam(e)}`),method:"GET",headers:a,queryParameters:i==null?void 0:i.queryParams,timeoutMs:((h=(u=i==null?void 0:i.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=i==null?void 0:i.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:i==null?void 0:i.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:O.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"GET","/v1/private/traces/{traceId}/comments/{commentId}")}getTraceThread(o,e){return _.fromPromise(this.__getTraceThread(o,e))}async __getTraceThread(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/retrieve"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:La.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:di.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===404?new I(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/threads/retrieve")}getTraceThreads(o={},e){return _.fromPromise(this.__getTraceThreads(o,e))}async __getTraceThreads(o={},e){var x,T,v,E,C,U,M,X,ie,ze,ke;let{page:t,size:i,projectName:a,projectId:s,truncate:p,stripAttachments:l,filters:c,sorting:d,fromTime:m,toTime:f}=o,u={page:t,size:i,project_name:a,project_id:s,truncate:p,strip_attachments:l,filters:c,sorting:d,from_time:m==null?void 0:m.toISOString(),to_time:f==null?void 0:f.toISOString()},h=z((x=this._options)==null?void 0:x.headers,P({"Comet-Workspace":(v=e==null?void 0:e.workspaceName)!=null?v:(T=this._options)==null?void 0:T.workspaceName}),e==null?void 0:e.headers),g=await k({url:R.join((C=(E=await b.get(this._options.baseUrl))!=null?E:await b.get(this._options.environment))!=null?C:S.Default,"v1/private/traces/threads"),method:"GET",headers:h,queryParameters:{...u,...e==null?void 0:e.queryParams},timeoutMs:((X=(M=e==null?void 0:e.timeoutInSeconds)!=null?M:(U=this._options)==null?void 0:U.timeoutInSeconds)!=null?X:60)*1e3,maxRetries:(ze=e==null?void 0:e.maxRetries)!=null?ze:(ie=this._options)==null?void 0:ie.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(ke=this._options)==null?void 0:ke.fetch,logging:this._options.logging});if(g.ok)return {data:ju.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")throw new w({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse});return A(g.error,g.rawResponse,"GET","/v1/private/traces/threads")}openTraceThread(o,e){return _.fromPromise(this.__openTraceThread(o,e))}async __openTraceThread(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/open"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:La.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/traces/threads/open")}scoreBatchOfThreads(o,e){return _.fromPromise(this.__scoreBatchOfThreads(o,e))}async __scoreBatchOfThreads(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/feedback-scores"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:mo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/traces/threads/feedback-scores")}scoreBatchOfTraces(o,e){return _.fromPromise(this.__scoreBatchOfTraces(o,e))}async __scoreBatchOfTraces(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/feedback-scores"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ii.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"PUT","/v1/private/traces/feedback-scores")}searchTraceThreads(o={},e){return _.fromPromise(this.__searchTraceThreads(o,e))}async __searchTraceThreads(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/threads/search"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:wo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),responseType:"streaming",timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:i.body,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/traces/threads/search")}searchTraces(o={},e){return _.fromPromise(this.__searchTraces(o,e))}async __searchTraces(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/traces/search"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:yo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),responseType:"streaming",timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:i.body,rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 401:throw new re(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"POST","/v1/private/traces/search")}updateThread(o,e,t){return _.fromPromise(this.__updateThread(o,e,t))}async __updateThread(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/threads/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:xo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/traces/threads/{threadModelId}")}updateThreadComment(o,e,t){return _.fromPromise(this.__updateThreadComment(o,e,t))}async __updateThreadComment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/threads/comments/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:O.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/traces/threads/comments/{commentId}")}updateTraceComment(o,e,t){return _.fromPromise(this.__updateTraceComment(o,e,t))}async __updateTraceComment(o,e,t){var p,l,c,d,m,f,u,h,g,x,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,P({"Comet-Workspace":(c=t==null?void 0:t.workspaceName)!=null?c:(l=this._options)==null?void 0:l.workspaceName}),t==null?void 0:t.headers),s=await k({url:R.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:S.Default,`v1/private/traces/comments/${R.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:O.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((h=(u=t==null?void 0:t.timeoutInSeconds)!=null?u:(f=this._options)==null?void 0:f.timeoutInSeconds)!=null?h:60)*1e3,maxRetries:(x=t==null?void 0:t.maxRetries)!=null?x:(g=this._options)==null?void 0:g.maxRetries,withCredentials:true,abortSignal:t==null?void 0:t.abortSignal,fetchFn:(T=this._options)==null?void 0:T.fetch,logging:this._options.logging});if(s.ok)return {data:void 0,rawResponse:s.rawResponse};if(s.error.reason==="status-code")throw s.error.statusCode===404?new I(s.error.body,s.rawResponse):new w({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse});return A(s.error,s.rawResponse,"PATCH","/v1/private/traces/comments/{commentId}")}};var un=class{constructor(o={}){this._options=F(o);}getWelcomeWizardStatus(o){return _.fromPromise(this.__getWelcomeWizardStatus(o))}async __getWelcomeWizardStatus(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/welcome-wizard"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:Du.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/private/welcome-wizard")}submitWelcomeWizard(o={},e){return _.fromPromise(this.__submitWelcomeWizard(o,e))}async __submitWelcomeWizard(o={},e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/welcome-wizard"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:_o.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:void 0,rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/welcome-wizard")}};var fn=class{constructor(o={}){this._options=F(o);}costsSummary(o,e){return _.fromPromise(this.__costsSummary(o,e))}async __costsSummary(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/workspaces/costs/summaries"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Gr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:xr.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/workspaces/costs/summaries")}getWorkspaceConfiguration(o){return _.fromPromise(this.__getWorkspaceConfiguration(o))}async __getWorkspaceConfiguration(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/workspaces/configurations"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:ui.parseOrThrow(t.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw t.error.statusCode===404?new I(t.error.body,t.rawResponse):new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/v1/private/workspaces/configurations")}upsertWorkspaceConfiguration(o,e){return _.fromPromise(this.__upsertWorkspaceConfiguration(o,e))}async __upsertWorkspaceConfiguration(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/workspaces/configurations"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ui.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:ui.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new D(i.error.body,i.rawResponse);case 422:throw new Z(i.error.body,i.rawResponse);default:throw new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}return A(i.error,i.rawResponse,"PUT","/v1/private/workspaces/configurations")}deleteWorkspaceConfiguration(o){return _.fromPromise(this.__deleteWorkspaceConfiguration(o))}async __deleteWorkspaceConfiguration(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"v1/private/workspaces/configurations"),method:"DELETE",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:void 0,rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw t.error.statusCode===404?new I(t.error.body,t.rawResponse):new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"DELETE","/v1/private/workspaces/configurations")}getCost(o,e){return _.fromPromise(this.__getCost(o,e))}async __getCost(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/workspaces/costs"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Gr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Ha.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/workspaces/costs")}getMetric(o,e){return _.fromPromise(this.__getMetric(o,e))}async __getMetric(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/workspaces/metrics"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Gr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Ha.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/workspaces/metrics")}metricsSummary(o,e){return _.fromPromise(this.__metricsSummary(o,e))}async __metricsSummary(o,e){var a,s,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,P({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(s=this._options)==null?void 0:s.workspaceName}),e==null?void 0:e.headers),i=await k({url:R.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:S.Default,"v1/private/workspaces/metrics/summaries"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Gr.jsonOrThrow(o,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((f=(m=e==null?void 0:e.timeoutInSeconds)!=null?m:(d=this._options)==null?void 0:d.timeoutInSeconds)!=null?f:60)*1e3,maxRetries:(h=e==null?void 0:e.maxRetries)!=null?h:(u=this._options)==null?void 0:u.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(g=this._options)==null?void 0:g.fetch,logging:this._options.logging});if(i.ok)return {data:Uu.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")throw i.error.statusCode===400?new D(i.error.body,i.rawResponse):new w({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse});return A(i.error,i.rawResponse,"POST","/v1/private/workspaces/metrics/summaries")}};var fi=class{constructor(o={}){this._options=F(o);}get systemUsage(){var o;return (o=this._systemUsage)!=null?o:this._systemUsage=new mn(this._options)}get alerts(){var o;return (o=this._alerts)!=null?o:this._alerts=new Ja(this._options)}get annotationQueues(){var o;return (o=this._annotationQueues)!=null?o:this._annotationQueues=new Ga(this._options)}get attachments(){var o;return (o=this._attachments)!=null?o:this._attachments=new Ka(this._options)}get check(){var o;return (o=this._check)!=null?o:this._check=new Ya(this._options)}get automationRuleEvaluators(){var o;return (o=this._automationRuleEvaluators)!=null?o:this._automationRuleEvaluators=new $a(this._options)}get chatCompletions(){var o;return (o=this._chatCompletions)!=null?o:this._chatCompletions=new Qa(this._options)}get dashboards(){var o;return (o=this._dashboards)!=null?o:this._dashboards=new Xa(this._options)}get datasets(){var o;return (o=this._datasets)!=null?o:this._datasets=new Za(this._options)}get experiments(){var o;return (o=this._experiments)!=null?o:this._experiments=new Oa(this._options)}get feedbackDefinitions(){var o;return (o=this._feedbackDefinitions)!=null?o:this._feedbackDefinitions=new qa(this._options)}get guardrails(){var o;return (o=this._guardrails)!=null?o:this._guardrails=new en(this._options)}get llmProviderKey(){var o;return (o=this._llmProviderKey)!=null?o:this._llmProviderKey=new rn(this._options)}get manualEvaluation(){var o;return (o=this._manualEvaluation)!=null?o:this._manualEvaluation=new tn(this._options)}get openTelemetryIngestion(){var o;return (o=this._openTelemetryIngestion)!=null?o:this._openTelemetryIngestion=new on(this._options)}get optimizations(){var o;return (o=this._optimizations)!=null?o:this._optimizations=new an(this._options)}get projects(){var o;return (o=this._projects)!=null?o:this._projects=new nn(this._options)}get prompts(){var o;return (o=this._prompts)!=null?o:this._prompts=new sn(this._options)}get serviceToggles(){var o;return (o=this._serviceToggles)!=null?o:this._serviceToggles=new cn(this._options)}get spans(){var o;return (o=this._spans)!=null?o:this._spans=new ln(this._options)}get traces(){var o;return (o=this._traces)!=null?o:this._traces=new dn(this._options)}get welcomeWizard(){var o;return (o=this._welcomeWizard)!=null?o:this._welcomeWizard=new un(this._options)}get workspaces(){var o;return (o=this._workspaces)!=null?o:this._workspaces=new fn(this._options)}get redirect(){var o;return (o=this._redirect)!=null?o:this._redirect=new pn(this._options)}isAlive(o){return _.fromPromise(this.__isAlive(o))}async __isAlive(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"is-alive/ping"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:t.body,rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/is-alive/ping")}version(o){return _.fromPromise(this.__version(o))}async __version(o){var i,a,s,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,P({"Comet-Workspace":(s=o==null?void 0:o.workspaceName)!=null?s:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:R.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:S.Default,"is-alive/ver"),method:"GET",headers:e,queryParameters:o==null?void 0:o.queryParams,timeoutMs:((m=(d=o==null?void 0:o.timeoutInSeconds)!=null?d:(c=this._options)==null?void 0:c.timeoutInSeconds)!=null?m:60)*1e3,maxRetries:(u=o==null?void 0:o.maxRetries)!=null?u:(f=this._options)==null?void 0:f.maxRetries,withCredentials:true,abortSignal:o==null?void 0:o.abortSignal,fetchFn:(h=this._options)==null?void 0:h.fetch,logging:this._options.logging});if(t.ok)return {data:t.body,rawResponse:t.rawResponse};if(t.error.reason==="status-code")throw new w({statusCode:t.error.statusCode,body:t.error.body,rawResponse:t.rawResponse});return A(t.error,t.rawResponse,"GET","/is-alive/ver")}};var Dh;(e=>(e.LogLevel=fe,e.ConsoleLogger=er))(Dh||(Dh={}));var ae=()=>uuid.v7();var Kr=class{static serializePromptToInfoDict(o){return {name:o.name,...o.id&&{id:o.id},version:{...o.versionId&&{id:o.versionId},...o.commit&&{commit:o.commit},template:o.prompt}}}static normalizeMetadata(o){if(!o)return {};if(typeof o=="object"&&!Array.isArray(o))return o;if(typeof o=="string")try{let e=JSON.parse(o);if(typeof e=="object"&&!Array.isArray(e))return e}catch{}return {}}static mergePromptsIntoMetadata(o,e,t){let i=t.map(p=>this.serializePromptToInfoDict(p)),a=this.normalizeMetadata(o),s=this.normalizeMetadata(e);return {...a,...s,opik_prompts:i}}static processTraceUpdate(o,e){let{prompts:t,...i}=o;if(!t||t.length===0)return i;let a=this.mergePromptsIntoMetadata(e,i.metadata,t);return {...i,metadata:a}}static processSpanUpdate(o,e){let{prompts:t,...i}=o;if(!t||t.length===0)return i;let a=this.mergePromptsIntoMetadata(e,i.metadata,t);return {...i,metadata:a}}};var hn=class n{constructor(o,e){this.data=o;this.opik=e;this.childSpans=[];this.end=()=>this.update({endTime:new Date});this.score=o=>{var e;this.opik.spanFeedbackScoresBatchQueue.create({...o,projectName:(e=this.data.projectName)!=null?e:this.opik.config.projectName,id:this.data.id,source:"sdk"});};this.update=o=>{var i;let e=Kr.processSpanUpdate(o,this.data.metadata),t={parentSpanId:this.data.parentSpanId,projectName:(i=this.data.projectName)!=null?i:this.opik.config.projectName,traceId:this.data.traceId,...e};return this.opik.spanBatchQueue.update(this.data.id,t),this.data={...this.data,...o},this};this.span=o=>{var a;let e=(a=this.data.projectName)!=null?a:this.opik.config.projectName,t={id:ae(),startTime:new Date,...o,projectName:e,traceId:this.data.traceId,parentSpanId:this.data.id};this.opik.spanBatchQueue.create(t);let i=new n(t,this.opik);return this.childSpans.push(i),i};}};var gn=class{constructor(o,e){this.data=o;this.opik=e;this.spans=[];this.end=()=>this.update({endTime:new Date});this.score=o=>{var e;this.opik.traceFeedbackScoresBatchQueue.create({...o,projectName:(e=this.data.projectName)!=null?e:this.opik.config.projectName,id:this.data.id,source:"sdk"});};this.span=o=>{var a,s;let e=(s=(a=this.data.projectName)!=null?a:o.projectName)!=null?s:this.opik.config.projectName,t={id:ae(),startTime:new Date,...o,projectName:e,traceId:this.data.id};this.opik.spanBatchQueue.create(t);let i=new hn(t,this.opik);return this.spans.push(i),i};this.update=o=>{var i;let e=Kr.processTraceUpdate(o,this.data.metadata),t={projectName:(i=this.data.projectName)!=null?i:this.opik.config.projectName,...e};return this.opik.traceBatchQueue.update(this.data.id,t),this.data={...this.data,...t},this};}};var Uh={EXPERIMENTS:"api/v1/session/redirect/experiments/",PROJECT_BY_NAME:"redirect/projects"},yn={EXPERIMENT_ID:"experiment_id",DATASET_ID:"dataset_id",PROJECT_NAME:"name",PATH:"path"},iR=n=>Object.entries(n).map(([o,e])=>`${o}=${encodeURIComponent(e)}`).join("&").replace(/%3A/g,":").replace(/%2F/g,"/").replace(/%26/g,"&").replace(/%3F/g,"?").replace(/%3D/g,"="),aR=n=>n.replace(/\/api$/,""),nR=n=>Buffer.from(n).toString("base64"),Fh=(n,o,e)=>{let t=iR(e),i=`${o}?${t}`;return new URL(i,n).toString()},Nh=({datasetId:n,experimentId:o,baseUrl:e})=>Fh(e,Uh.EXPERIMENTS,{[yn.EXPERIMENT_ID]:o,[yn.DATASET_ID]:n,[yn.PATH]:nR(e)});var Mh=({projectName:n,workspaceName:o,apiUrl:e})=>{let t=aR(e),i=`${o}/${Uh.PROJECT_BY_NAME}`;return Fh(t,i,{[yn.PROJECT_NAME]:n})};var sR=300,bn=100,hi=class{constructor({action:o,batchSize:e=bn,delay:t,enableBatch:i,name:a="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=(o,e)=>{if(this.queue.set(o,e),!this.enableBatch){this.flush();return}if(this.queue.size>=this.batchSize){this.flush();return}this.debounceFlush();};this.update=(o,e)=>{let t=this.queue.get(o);t&&(this.queue.set(o,{...t,...e}),this.debounceFlush());};this.flush=async()=>{if(this.queue.size===0)return this.promise;let o=new Map(this.queue);this.queue.clear(),j.debug(`Adding ${o.size} items to ${this.name} promise:`,o),this.promise=this.promise.finally(()=>(j.debug(`Flushing ${this.name}:`,o),this.action(o))).catch(e=>{j.error(`Failed to flush ${this.name}:`,e,o);}),await this.promise;};this.action=o,this.batchSize=e,this.delay=t,this.enableBatch=i,this.name=a;}},xe=class{constructor({delay:o=sR,enableCreateBatch:e=true,enableUpdateBatch:t=false,enableDeleteBatch:i=true,createBatchSize:a=bn,updateBatchSize:s=bn,deleteBatchSize:p=bn,name:l="BatchQueue"}={}){this.create=o=>{let e=this.getId(o);this.createQueue.add(e,o);};this.get=async o=>{let e=this.createQueue.queue.get(o);return e||this.getEntity(o)};this.update=(o,e)=>{if(this.createQueue.queue.get(o)){this.createQueue.update(o,e);return}this.updateQueue.add(o,e);};this.delete=o=>{if(this.createQueue.queue.has(o)){this.createQueue.queue.delete(o);return}this.deleteQueue.add(o);};this.flush=async()=>{await this.createQueue.flush(),await this.updateQueue.flush(),await this.deleteQueue.flush();};this.name=l,this.createQueue=new hi({action:async c=>{await this.createEntities(Array.from(c.values()));},delay:o,enableBatch:e,batchSize:a,name:`${l}:createQueue`}),this.updateQueue=new hi({action:async c=>{await this.createQueue.flush();let d=Array.from(c.entries());for(let[m,f]of d)await this.updateEntity(m,f);},delay:o,enableBatch:t,batchSize:s,name:`${l}:updateQueue`}),this.deleteQueue=new hi({action:async c=>{await this.createQueue.flush(),await this.updateQueue.flush(),await this.deleteEntities(Array.from(c.keys()));},delay:o,enableBatch:i,batchSize:p,name:`${l}:deleteQueue`});}};var xn=class extends xe{constructor(e,t){super({delay:t,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,t){await this.api.spans.updateSpan(e,{body:t},this.api.requestOptions);}async deleteEntities(e){for(let t of e)await this.api.spans.deleteSpanById(t,this.api.requestOptions);}};var Rn=class extends xe{constructor(e,t){super({delay:t,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 t of e)await this.api.spans.deleteSpanFeedbackScore(t.id,{body:{name:t.name}},this.api.requestOptions);}};var wn=class extends xe{constructor(e,t){super({delay:t,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,t){await this.api.traces.updateTrace(e,{body:t},this.api.requestOptions);}async deleteEntities(e){await this.api.traces.deleteTraces({ids:e},this.api.requestOptions);}};var _n=class extends xe{constructor(e,t){super({delay:t,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 t of e)await this.api.traces.deleteTraceFeedbackScore(t.id,{body:{name:t.name}},this.api.requestOptions);}};var zn=class extends fi{constructor(e){var i;let t={...e==null?void 0:e.headers,...(i=e==null?void 0:e.requestOptions)==null?void 0:i.headers};(e==null?void 0:e.apiKey)!==void 0&&(t.authorization=e.apiKey);super({...e,headers:t});this.setHeaders=e=>{this.requestOptions.headers=e;};this.requestOptions=(e==null?void 0:e.requestOptions)||{};}};var kn=class extends xe{constructor(e,t){super({delay:t,enableCreateBatch:true,enableUpdateBatch:true,enableDeleteBatch:true,name:"DatasetBatchQueue"});this.api=e;}getId(e){return e.id||""}async createEntities(e){for(let t of e)await this.api.datasets.createDataset(t,this.api.requestOptions);}async getEntity(e){try{return await this.api.datasets.getDatasetById(e,this.api.requestOptions)}catch{return}}async updateEntity(e,t){await this.api.datasets.updateDataset(e,{name:t.name||"",visibility:t.visibility,description:t.description},this.api.requestOptions);}async deleteEntities(e){await this.api.datasets.deleteDatasetsBatch({ids:e},this.api.requestOptions);}};var Nu=null;async function Wh(){return Nu||(Nu=await pR__default.default()),Nu}var gi=class n{constructor(o){let{id:e,traceId:t,spanId:i,source:a,...s}=o;this.id=e||ae(),this.traceId=t,this.spanId=i,this.source=a||ms.Sdk,this.data={...s};}getContent(o=false){return o?{...this.data,id:this.id}:{...this.data}}async contentHash(){let o=this.getContent(),e=cR__default.default(o);return (await Wh()).h32(e,43981).toString(16)}toApiModel(){return {id:this.id,traceId:this.traceId,spanId:this.spanId,source:this.source,data:this.getContent()}}static fromApiModel(o){return new n({id:o.id,traceId:o.traceId,spanId:o.spanId,source:o.source,...o.data})}};async function Ge(n,o,e){var p;if(e===0)return [];let t=new util.TextDecoder("utf-8"),i=[],a="",s=n.getReader();try{for(;;){let{done:l,value:c}=await s.read();if(l)break;let d=c;a+=t.decode(d,{stream:!0});let m=a.split(`
|
|
4
|
+
`);a=(p=m.pop())!=null?p:"";for(let f of m)if(!(!f.trim()||f==="{}"||f==="[]"||f==="null"))try{let u=JSON.parse(f),h=o.parse(u);if(h.ok){if(i.push(h.value),e!==void 0&&i.length>=e)return s.releaseLock(),i}else j.error("Error parsing experiment item:",h.errors);}catch(u){j.error("Error parsing JSON line:",u instanceof Error?u.message:String(u));}}if(a.trim()&&a!=="{}"&&a!=="[]"&&a!=="null")try{let l=JSON.parse(a),c=o.parse(l);c.ok?i.push(c.value):j.error("Error parsing experiment item:",c.errors);}catch(l){j.error("Error parsing remaining buffer:",l instanceof Error?l.message:String(l));}}catch(l){j.error("Error processing stream:",l instanceof Error?l.message:String(l));}finally{s.releaseLock();}return i}function yi(n,o){let e=[];for(let t=0;t<n.length;t+=o.maxBatchSize)e.push(n.slice(t,t+o.maxBatchSize));return e}var be=class extends Error{constructor(o){var e;super(o.message),this.name=this.constructor.name,this.code=o.code,this.statusCode=o.statusCode,this.details=o.details,this.originalError=o.originalError,j.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 Bh={DATASET_NOT_FOUND:n=>`Dataset with name '${n}' not found`,DATASET_ITEM_NOT_FOUND:n=>`Dataset item with id '${n}' not found`,DATASET_ITEM_MISSING_ID:n=>`Item at index ${n} is missing an ID required for update`,INVALID_JSON_FORMAT:n=>`Invalid JSON format${n?": "+n:""}`,JSON_NOT_ARRAY:"JSON input must be an array of objects",ITEM_NOT_OBJECT:(n,o)=>`Item at position ${n} is not an object (${o})`,INSERTION_FAILED:n=>`Failed to insert items from JSON: ${n}`,DATASET_JSON_PARSE_ERROR:n=>`Failed to parse JSON input: ${n}`};var mR={DATASET_ITEM_MISSING_ID:"DATASET_ITEM_MISSING_ID"},Sn=class extends be{constructor(o){super({message:Bh.DATASET_ITEM_MISSING_ID(o),code:mR.DATASET_ITEM_MISSING_ID});}};var dR={SEARCH_TIMEOUT:"SEARCH_TIMEOUT"},Pn=class extends be{constructor(o){super({message:o,code:dR.SEARCH_TIMEOUT});}};var An={JSON_NOT_ARRAY:n=>`JSON input must be an array of objects${n?` (${n})`:""}`,JSON_PARSE_ERROR:"Failed to parse JSON input",JSON_ITEM_NOT_OBJECT:(n,o)=>`Item at position ${n} is not an object (${o})`};var Mu={JSON_PARSE_ERROR:"JSON_PARSE_ERROR",JSON_NOT_ARRAY:"JSON_NOT_ARRAY",JSON_ITEM_NOT_OBJECT:"JSON_ITEM_NOT_OBJECT"},Tn=class extends be{constructor(o){let e=o instanceof Error?o:new Error(String(o));super({message:An.JSON_PARSE_ERROR,code:Mu.JSON_PARSE_ERROR,originalError:e});}},vn=class extends be{constructor(o){super({message:An.JSON_NOT_ARRAY(o),code:Mu.JSON_NOT_ARRAY});}},jn=class extends be{constructor(o,e){super({message:An.JSON_ITEM_NOT_OBJECT(o,e),code:Mu.JSON_ITEM_NOT_OBJECT});}};var $r=class{constructor({name:o,description:e,id:t},i){this.opik=i;this.idToHash=new Map;this.hashes=new Set;this.id=t||ae(),this.name=o,this.description=e;}async insert(o){if(!o||o.length===0)return;await this.opik.datasetBatchQueue.flush(),await this.syncHashes();let e=await this.getDeduplicatedItems(o),t=yi(e,{maxBatchSize:1e3}),i=ae();try{let a=0;for(let s of t)await this.opik.api.datasets.createOrUpdateDatasetItems({datasetId:this.id,items:s,batchGroupId:i}),a+=s.length,j.info(`Inserted ${Math.min(a,e.length)} of ${e.length} items into dataset ${this.id}`);}catch(a){throw j.error(`Error inserting items into dataset: ${a instanceof Error?a.message:String(a)}`),a}}async update(o){if(!(!o||o.length===0)){for(let e=0;e<o.length;e++)if(!o[e].id)throw new Sn(e);await this.insert(o);}}async delete(o){if(!o||o.length===0){j.info("No item IDs provided for deletion");return}let e=yi(o,{maxBatchSize:100}),t=ae();for await(let i of e){j.debug("Deleting dataset items batch",{batchSize:i.length,datasetId:this.id}),await this.opik.api.datasets.deleteDatasetItems({itemIds:i,batchGroupId:t});for(let a of i)if(this.idToHash.has(a)){let s=this.idToHash.get(a);this.hashes.delete(s),this.idToHash.delete(a);}}}async clear(){let e=(await this.getItems()).map(t=>t.id).filter(Boolean);e.length!==0&&await this.delete(e);}async getItems(o,e){return (await this.getItemsAsDataclasses(o,e)).map(i=>i.getContent(true))}async getItemsAsDataclasses(o,e){let t=o?Math.min(o,2e3):2e3,i=await this.opik.api.datasets.streamDatasetItems({datasetName:this.name,lastRetrievedId:e,steamLimit:t});return (await Ge(i,H.DatasetItemPublic,o)).map(s=>gi.fromApiModel(s))}async insertFromJson(o,e={},t=[]){let i;try{i=JSON.parse(o);}catch(s){throw new Tn(s)}if(!Array.isArray(i))throw new vn(typeof i);if(i.length===0)return;for(let s=0;s<i.length;s++){let p=i[s];if(typeof p!="object"||p===null)throw new jn(s,typeof p)}let a=i.map(s=>{let p=s,l={};for(let[c,d]of Object.entries(p)){if(t.includes(c))continue;let m=e[c]||c;l[m]=d;}return l});await this.insert(a);}async toJson(o={}){let t=(await this.getItems()).map(i=>{let a={...i};if(Object.keys(o).length>0){for(let[s,p]of Object.entries(o))if(s in a){let l=a[s];delete a[s],a[p]=l;}}return a});return cR__default.default(t)}async getDeduplicatedItems(o){let e=[];for(let t of o){let i=new gi(t),a=await i.contentHash();if(this.hashes.has(a)){j.debug("Duplicate item found - skipping",{contentHash:a,datasetId:this.id});continue}e.push(i.toApiModel()),this.hashes.add(a),this.idToHash.set(i.id,a);}return e}clearHashState(){this.idToHash.clear(),this.hashes.clear();}async syncHashes(){j.debug("Syncing dataset hashes with backend",{datasetId:this.id});try{let o=await this.getItemsAsDataclasses();this.clearHashState();for(let e of o){let t=await e.contentHash();this.idToHash.set(e.id,t),this.hashes.add(t);}j.debug("Dataset hash sync completed",{datasetId:this.id,itemCount:o.length});}catch(o){if(o instanceof w&&o.statusCode===404){j.debug("Dataset not found - starting with empty hash state",{datasetId:this.id}),this.clearHashState();return}throw o}}};var Wu=class extends Error{constructor(o){super(o),this.name="DatasetError";}},bi=class extends Wu{constructor(o){super(`Dataset with name '${o}' not found`),this.name="DatasetNotFoundError";}};var En=class{constructor(o){if(!o.datasetItemId)throw new Error("datasetItemId is required");if(!o.traceId)throw new Error("traceId is required");this.datasetItemId=o.datasetItemId,this.traceId=o.traceId;}},Cn=class n{constructor(o){this.id=o.id,this.datasetItemId=o.datasetItemId,this.traceId=o.traceId,this.datasetItemData=o.datasetItemData,this.evaluationTaskOutput=o.evaluationTaskOutput,this.feedbackScores=[...o.feedbackScores];}static fromRestExperimentItemCompare(o){var t,i;let e=(i=(t=o.feedbackScores)==null?void 0:t.map(a=>({categoryName:a.categoryName,name:a.name,reason:a.reason,value:a.value,source:a.source})))!=null?i:[];return new n({id:o.id,traceId:o.traceId,datasetItemId:o.datasetItemId,datasetItemData:o.input,evaluationTaskOutput:o.output,feedbackScores:e})}};var Rr=class{constructor({id:o,name:e,datasetName:t,prompts:i},a){this.opik=a;this.id=o||ae(),this._name=e,this.datasetName=t,this.prompts=i;}get name(){return this._name}async ensureNameLoaded(){if(this._name!==void 0)return this._name;let o=await this.opik.api.experiments.getExperimentById(this.id);if(this._name=o.name,!this._name)throw new Error("Experiment name is not loaded");return this._name}async insert(o){if(o.length===0)return;let e=o.map(i=>({id:ae(),experimentId:this.id,datasetItemId:i.datasetItemId,traceId:i.traceId})),t=yi(e,{maxBatchSize:50});try{for(let i of t)await this.opik.api.experiments.createExperimentItems({experimentItems:i});j.debug(`Inserted ${o.length} items into experiment ${this.id}`);}catch(i){throw j.error(`Error inserting items into experiment: ${i instanceof Error?i.message:String(i)}`),i}}async getItems(o){let e=[],{maxResults:i,truncate:a=false}=o||{},s,p=true;try{for(;p&&!(i!==void 0&&e.length>=i);){let l=i?Math.min(i-e.length,2e3):2e3,c=await this.opik.api.experiments.streamExperimentItems({experimentName:this.name,limit:l,lastRetrievedId:s,truncate:a});try{let d=await Ge(c,H.ExperimentItemCompare,l);if(d.length===0){p=!1;break}for(let m of d){let f=Cn.fromRestExperimentItemCompare(m);if(e.push(f),i!==void 0&&e.length>=i){p=!1;break}}s=d[d.length-1].id;}catch(d){j.error("Error parsing experiment item: "+(d instanceof Error?d.message:String(d))),p=!1;break}}}catch(l){throw j.error("Error retrieving experiment items: "+(l instanceof Error?l.message:String(l))),l}return j.info(`Retrieved ${e.length} items${i?` (limited by maxResults=${i})`:""}`),e}async getUrl(){let o=await this.opik.getDataset(this.datasetName),e=this.opik.config.apiUrl||Xn.apiUrl;return Nh({datasetId:o.id,experimentId:this.id,baseUrl:e})}};var In={EXPERIMENT_NOT_FOUND:n=>`Experiment with name '${n}' not found`,INVALID_CONFIG_TYPE:n=>`experimentConfig must be a plain object, but ${n} 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:
|
|
5
5
|
1. Use prompts parameter: buildMetadataAndPromptVersions(config, [prompt1, prompt2])
|
|
6
6
|
2. Use config only: buildMetadataAndPromptVersions({ ...config, prompts: {...} })
|
|
7
7
|
|
|
8
|
-
The prompts parameter is recommended for prompt version tracking.`};var
|
|
8
|
+
The prompts parameter is recommended for prompt version tracking.`};var Bu={EXPERIMENT_NOT_FOUND:"EXPERIMENT_NOT_FOUND",INVALID_CONFIG_TYPE:"INVALID_CONFIG_TYPE",CONFIG_PROMPTS_CONFLICT:"CONFIG_PROMPTS_CONFLICT"},xi=class extends be{constructor(o){super({message:In.EXPERIMENT_NOT_FOUND(o),code:Bu.EXPERIMENT_NOT_FOUND});}},Ri=class n extends be{constructor(o,e){super({message:o,code:e});}static invalidConfigType(o){return new n(In.INVALID_CONFIG_TYPE(o),Bu.INVALID_CONFIG_TYPE)}static promptsConflict(){return new n(In.CONFIG_PROMPTS_CONFLICT(),Bu.CONFIG_PROMPTS_CONFLICT)}};function Vh(n,o){if(n!==void 0&&(typeof n!="object"||n===null||Array.isArray(n)))throw Ri.invalidConfigType(typeof n);if(o&&o.length>0&&(n!=null&&n.prompts))throw Ri.promptsConflict();if(!n&&(!o||o.length===0))return [void 0,void 0];let e=n?structuredClone(n):{},t;if(o&&o.length>0){t=[];let i={};for(let a of o)t.push({id:a.versionId}),i[a.name]=a.prompt;e.prompts=i;}return Object.keys(e).length===0?[void 0,void 0]:[e,t]}var Re={MUSTACHE:"mustache",JINJA2:"jinja2"},ce={Text:"text",Chat:"chat"};var G=class n extends Error{constructor(o){super(o),this.name="PromptValidationError",Object.setPrototypeOf(this,n.prototype);}},wr=class n extends Error{constructor(o,e,t){let i=`Prompt '${o}' has template_structure='${e}' but attempted to access as '${t}'. Template structure is immutable after creation.`;super(i),this.name="PromptTemplateStructureMismatch",this.promptName=o,this.existingStructure=e,this.attemptedStructure=t,Object.setPrototypeOf(this,n.prototype);}};function hR(n){try{let e=fR__default.default.parse(n).filter(t=>{let i=t[0];return i==="name"||i==="#"||i==="&"||i==="^"}).map(t=>t[1].split(".")[0]);return new Set(e)}catch(o){throw new G(`Invalid Mustache template syntax: ${o instanceof Error?o.message:String(o)}`)}}function Lh(n,o,e){if(e!=="mustache")return;let t=hR(n),i=new Set(Object.keys(o)),a=new Set([...t].filter(s=>!i.has(s)));if(a.size>0){let s=[];throw s.push(`Missing required variables: ${[...a].join(", ")}`),s.push(`Template placeholders: {${[...t].join(", ")}}`),s.push(`Provided variables: {${[...i].join(", ")}}`),new G(`Template variables validation failed:
|
|
9
9
|
${s.join(`
|
|
10
|
-
`)}`)}}function le(n,o,e){try{switch(
|
|
11
|
-
`)}function
|
|
10
|
+
`)}`)}}function le(n,o,e){try{switch(Lh(n,o,e),e){case "mustache":return fR__default.default.render(n,o,{},{escape:t=>t});case "jinja2":return yR__default.default.renderString(n,o);default:return n}}catch(t){if(t instanceof G)throw t;let i=t instanceof Error?t.message:String(t);throw new G(`Failed to format prompt template: ${i}`)}}function Gh(n){let o=[];for(let e=0;e<n.length;e++){let t=n[e];if(o.push(`Message ${e+1} [${t.role}]:`),typeof t.content=="string")o.push(Jh(t.content));else if(Array.isArray(t.content))for(let i=0;i<t.content.length;i++){let a=t.content[i];if(o.push(` Part ${i+1}:`),o.push(` Type: ${a.type}`),a.type==="text"&&"text"in a){let s=a;o.push(Jh(String(s.text),4)),Vu(s,["type","text"],o,4);}else if(a.type==="image_url"&&"image_url"in a){let s=a,p=s.image_url;o.push(` URL: ${p.url}`),Hh(p,["url"],o,4),Vu(s,["type","image_url"],o,4);}else if(a.type==="video_url"&&"video_url"in a){let s=a,p=s.video_url;o.push(` URL: ${p.url}`),Hh(p,["url"],o,4),Vu(s,["type","video_url"],o,4);}else o.push(" [Difference found in unrecognized content type]");}e<n.length-1&&o.push("");}return o.join(`
|
|
11
|
+
`)}function Vu(n,o,e,t=4){let i=Object.keys(n).filter(a=>!o.includes(a));if(i.length>0)for(let a of i.sort()){let s=n[a];e.push(`${" ".repeat(t)}${a}: ${Kh(s)}`);}}function Hh(n,o,e,t=4){let i=Object.keys(n).filter(a=>!o.includes(a));if(i.length>0)for(let a of i.sort()){let s=n[a];e.push(`${" ".repeat(t)}${a}: ${Kh(s)}`);}}function Kh(n){return n===null?"null":n===void 0?"undefined":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):Array.isArray(n)||typeof n=="object"?JSON.stringify(n):String(n)}function Jh(n,o=2){let e=" ".repeat(o);return n.split(`
|
|
12
12
|
`).map(t=>`${e}${t}`).join(`
|
|
13
|
-
`)}var
|
|
13
|
+
`)}var wi=class n{constructor(o){this.id=o.versionId,this.name=o.name,this.prompt=o.prompt,this.commit=o.commit,this.type=o.type,this.metadata=o.metadata,this.changeDescription=o.changeDescription,this.tags=o.tags,this.createdAt=o.createdAt,this.createdBy=o.createdBy;}format(o){return le(this.prompt,o,this.type)}getVersionAge(){return this.createdAt?dateFns.formatDistanceToNow(new Date(this.createdAt),{addSuffix:true}):"Unknown"}getVersionInfo(){let o=[`[${this.commit}]`];if(this.createdAt){let e=new Date(this.createdAt);o.push(e.toISOString().split("T")[0]);}return this.createdBy&&o.push(`by ${this.createdBy}`),this.changeDescription&&o.push(`- ${this.changeDescription}`),o.join(" ")}compareTo(o){let e=`Current version [${this.commit}]`,t=`Other version [${o.commit}]`,i=this.prompt,a=o.prompt;this.isChatPrompt(this.prompt)&&(i=this.formatChatPromptString(this.prompt)),this.isChatPrompt(o.prompt)&&(a=this.formatChatPromptString(o.prompt));let s=jestDiff.diffStringsUnified(a,i,{aAnnotation:t,bAnnotation:e,includeChangeCounts:true,contextLines:3,expand:false});return j.info(`
|
|
14
14
|
Prompt version comparison:
|
|
15
|
-
${s}`),s}isChatPrompt(o){try{let e=JSON.parse(o);return Array.isArray(e)&&e.length>0&&typeof e[0]=="object"&&"role"in e[0]&&"content"in e[0]}catch{return false}}formatChatPromptString(o){try{let e=JSON.parse(o);return
|
|
15
|
+
${s}`),s}isChatPrompt(o){try{let e=JSON.parse(o);return Array.isArray(e)&&e.length>0&&typeof e[0]=="object"&&"role"in e[0]&&"content"in e[0]}catch{return false}}formatChatPromptString(o){try{let e=JSON.parse(o);return Gh(e)}catch{return o}}static fromApiResponse(o,e){var t;if(!e.template)throw new G("Invalid API response: missing required field 'template'");if(!e.commit)throw new G("Invalid API response: missing required field 'commit'");if(!e.promptId)throw new G("Invalid API response: missing required field 'promptId'");if(!e.id)throw new G("Invalid API response: missing required field 'id'");return new n({name:o,prompt:e.template,commit:e.commit,promptId:e.promptId,versionId:e.id,type:(t=e.type)!=null?t:Re.MUSTACHE,metadata:e.metadata,changeDescription:e.changeDescription,tags:e.tags,createdAt:e.createdAt?new Date(e.createdAt):void 0,createdBy:e.createdBy})}};var Qr=class{constructor(o,e){var t,i;this.id=o.promptId,this.versionId=o.versionId,this.commit=o.commit,this.type=(t=o.type)!=null?t:"mustache",this.changeDescription=o.changeDescription,this.templateStructure=(i=o.templateStructure)!=null?i:"text",this._name=o.name,this._description=o.description,this._tags=o.tags?[...o.tags]:[],this._metadata=o.metadata,this.opik=e;}get name(){return this._name}get description(){return this._description}get tags(){return Object.freeze([...this._tags])}get metadata(){if(this._metadata)return structuredClone(this._metadata)}async updateProperties(o){var e,t,i,a;return await this.opik.api.prompts.updatePrompt(this.id,{name:(e=o.name)!=null?e:this._name,description:o.description,tags:o.tags},this.opik.api.requestOptions),this._name=(t=o.name)!=null?t:this._name,this._description=(i=o.description)!=null?i:this._description,this._tags=(a=o.tags)!=null?a:this._tags,this}async delete(){await this.opik.deletePrompts([this.id]);}async getVersions(o){var e;j.debug("Getting versions for prompt",{promptId:this.id,name:this.name});try{let t=[],i=1,a=100;for(;;){let p=(e=(await this.opik.api.prompts.getPromptVersions(this.id,{page:i,size:a,search:o==null?void 0:o.search,sorting:o==null?void 0:o.sorting,filters:o==null?void 0:o.filters},this.opik.api.requestOptions)).content)!=null?e:[];if(t.push(...p),p.length<a)break;i++;}return j.debug("Successfully retrieved prompt versions",{promptId:this.id,name:this.name,totalVersions:t.length}),t.map(s=>wi.fromApiResponse(this.name,s))}catch(t){throw j.error("Failed to get prompt versions",{promptId:this.id,name:this.name,error:t}),t}}async restoreVersion(o){j.debug("Restoring prompt version",{promptId:this.id,name:this.name,versionId:o.id,versionCommit:o.commit});try{let e=await this.opik.api.prompts.restorePromptVersion(this.id,o.id,this.opik.api.requestOptions);return j.debug("Successfully restored prompt version",{promptId:this.id,name:this.name,restoredVersionId:e.id,restoredCommit:e.commit}),e}catch(e){throw j.error("Failed to restore prompt version",{promptId:this.id,name:this.name,versionId:o.id,versionCommit:o.commit,error:e}),e}}async retrieveVersionByCommit(o){try{return await this.opik.api.prompts.retrievePromptVersion({name:this.name,commit:o},this.opik.api.requestOptions)}catch(e){if(e&&typeof e=="object"&&"statusCode"in e&&e.statusCode===404)return null;throw j.error("Failed to retrieve prompt version",{promptName:this.name,commit:o,error:e}),e}}};var Ke=class n extends Qr{constructor(o,e){super({...o,templateStructure:ce.Text},e),this.prompt=o.prompt;}get template(){return this.prompt}format(o){return le(this.prompt,o,this.type)}static fromApiResponse(o,e,t){var a;if(!e.template)throw new G("Invalid API response: missing required field 'template'");if(!e.commit)throw new G("Invalid API response: missing required field 'commit'");if(!e.promptId)throw new G("Invalid API response: missing required field 'promptId'");if(!e.id)throw new G("Invalid API response: missing required field 'id' (version ID)");let i=(a=e.type)!=null?a:Re.MUSTACHE;if(i!=="mustache"&&i!=="jinja2")throw new G(`Invalid API response: unknown prompt type '${i}'`);return new n({promptId:e.promptId,versionId:e.id,name:o.name,prompt:e.template,commit:e.commit,metadata:e.metadata,type:i,changeDescription:e.changeDescription,description:o.description,tags:o.tags},t)}async useVersion(o){var t;let e=await this.restoreVersion(o);return n.fromApiResponse({name:this.name,description:this.description,tags:Array.from((t=this.tags)!=null?t:[])},e,this.opik)}async getVersion(o){var t;let e=await this.retrieveVersionByCommit(o);return e?n.fromApiResponse({name:this.name,description:this.description,tags:Array.from((t=this.tags)!=null?t:[])},e,this.opik):null}};var Dn=class{constructor(o,e="mustache",t=false){this.messages=o,this.templateType=e,this.validatePlaceholders=t;}format(o,e){let t={vision:true,video:true,...e},i=[];for(let a of this.messages){let s=a.role;if(!s)continue;let p=a.content,l;if(typeof p=="string")l=le(p,o,this.templateType);else if(Array.isArray(p))l=this.renderContentParts(p,o,t);else throw new G(`Invalid message content type. Expected string or array of content parts, got: ${typeof p}`);i.push({role:s,content:l});}return i}renderContentParts(o,e,t){var s,p,l,c,d,m,f;let i=[],a=false;for(let u of o){if(!u||typeof u!="object")continue;switch(u.type){case "text":{let x=le(u.text||"",e,this.templateType);i.push({type:"text",text:x});break}case "image_url":{if(t.vision===false)a=true,i.push({type:"text",text:"<<<image>>><<</image>>>"});else {let g=u,x=((s=g.image_url)==null?void 0:s.url)||"",T=le(x,e,this.templateType);if(T){let v={type:"image_url",image_url:{url:T}};(p=g.image_url)!=null&&p.detail&&(v.image_url.detail=g.image_url.detail),i.push(v);}}break}case "video_url":{if(t.video===false)a=true,i.push({type:"text",text:"<<<video>>><<</video>>>"});else {let g=u,x=((l=g.video_url)==null?void 0:l.url)||"",T=le(x,e,this.templateType);if(T){let v={type:"video_url",video_url:{url:T}};(c=g.video_url)!=null&&c.mime_type&&(v.video_url.mime_type=g.video_url.mime_type),(d=g.video_url)!=null&&d.duration&&(v.video_url.duration=g.video_url.duration),(m=g.video_url)!=null&&m.format&&(v.video_url.format=g.video_url.format),(f=g.video_url)!=null&&f.detail&&(v.video_url.detail=g.video_url.detail),i.push(v);}}break}default:i.push(u);}}if(a){let u=[];for(let h of i)if(h.type==="text"){let g=h.text;g&&u.push(g);}else u.push(JSON.stringify(h));return u.join(`
|
|
16
16
|
|
|
17
|
-
`)}return i.length===1&&i[0].type==="text"?i[0].text:i}};var _r=class n extends Qr{constructor(o,e){super({...o,templateStructure:ce.Chat},e),this.messages=o.messages,this.chatTemplate=new Cn(o.messages,this.type);}get template(){return structuredClone(this.messages)}format(o,e){return this.chatTemplate.format(o,e)}static fromApiResponse(o,e,t){var s;if(!e.template)throw new G("Invalid API response: missing required field 'template'");if(!e.commit)throw new G("Invalid API response: missing required field 'commit'");if(!e.promptId)throw new G("Invalid API response: missing required field 'promptId'");if(!e.id)throw new G("Invalid API response: missing required field 'id' (version ID)");let i;try{if(i=JSON.parse(e.template),!Array.isArray(i))throw new G("Invalid chat prompt template: expected array of messages")}catch(p){throw p instanceof G?p:new G(`Failed to parse chat prompt template: ${p instanceof Error?p.message:String(p)}`)}let a=(s=e.type)!=null?s:Re.MUSTACHE;if(a!=="mustache"&&a!=="jinja2")throw new G(`Invalid API response: unknown prompt type '${a}'`);return new n({promptId:e.promptId,versionId:e.id,name:o.name,messages:i,commit:e.commit,metadata:e.metadata,type:a,changeDescription:e.changeDescription,description:o.description,tags:o.tags},t)}async useVersion(o){var t;let e=await this.restoreVersion(o);return n.fromApiResponse({name:this.name,description:this.description,tags:Array.from((t=this.tags)!=null?t:[])},e,this.opik)}async getVersion(o){var t;let e=await this.retrieveVersionByCommit(o);return e?n.fromApiResponse({name:this.name,description:this.description,tags:Array.from((t=this.tags)!=null?t:[])},e,this.opik):null}};async function Kh(n,o,e){try{return await n.retrievePromptVersion({name:o},e)}catch(t){if(wR(t))return null;throw t}}function $h(n,o,e){return o?o.template!==n.prompt||!RR(o.metadata,n.metadata)||o.type!==e:true}function RR(n,o){let e=n!=null?n:{},t=o!=null?o:{};return xR__default.default(e,t)}function wR(n){return typeof n=="object"&&n!==null&&"statusCode"in n&&n.statusCode===404}var ue=class{constructor(o){this.input=o;this.cursor=0;}getPosition(){return this.cursor}getRemainingInput(){return this.input.slice(this.cursor)}getFullInput(){return this.input}isAtEnd(){return this.cursor>=this.input.length}peekChar(){return this.input[this.cursor]}peekCharAt(o){return this.input[this.cursor+o]}consumeChar(){return this.input[this.cursor++]}advance(o=1){this.cursor+=o;}skipWhitespace(){for(;this.cursor<this.input.length&&/\s/.test(this.input[this.cursor]);)this.cursor++;}consumeWhile(o){let e=this.cursor;for(;this.cursor<this.input.length&&o(this.input[this.cursor]);)this.cursor++;return this.input.slice(e,this.cursor)}sliceFrom(o){return this.input.slice(o,this.cursor)}static isFieldChar(o){return /[a-zA-Z0-9_]/.test(o)}static isLetterChar(o){return /[a-zA-Z]/.test(o)}static isDigitChar(o){return /\d/.test(o)}static isWhitespaceChar(o){return /\s/.test(o)}static isQuoteChar(o){return o==='"'||o==="'"}};var q={STRING_OPS:["=","contains","not_contains","starts_with","ends_with","!=",">","<"],NUMERIC_OPS:["=","!=",">","<",">=","<="],DATETIME_OPS:["=",">","<",">=","<="],LIST_OPS:["contains"],DICT_OPS:["=","contains",">","<"],LIMITED_STRING_OPS:["=","contains","not_contains"]},$e={id:"string",name:"string",status:"string",start_time:"date_time",end_time:"date_time",input:"string",output:"string",metadata:"dictionary",feedback_scores:"feedback_scores_number",tags:"list","usage.total_tokens":"number","usage.prompt_tokens":"number","usage.completion_tokens":"number",duration:"number",number_of_messages:"number",created_by:"string",thread_id:"string",total_estimated_cost:"number",type:"string",model:"string",provider:"string"},Qh={id:q.STRING_OPS,name:q.STRING_OPS,status:q.LIMITED_STRING_OPS,start_time:q.DATETIME_OPS,end_time:q.DATETIME_OPS,input:q.LIMITED_STRING_OPS,output:q.LIMITED_STRING_OPS,metadata:q.DICT_OPS,feedback_scores:q.NUMERIC_OPS,tags:q.LIST_OPS,"usage.total_tokens":q.NUMERIC_OPS,"usage.prompt_tokens":q.NUMERIC_OPS,"usage.completion_tokens":q.NUMERIC_OPS,duration:q.NUMERIC_OPS,number_of_messages:q.NUMERIC_OPS,created_by:q.STRING_OPS,thread_id:q.STRING_OPS,total_estimated_cost:q.NUMERIC_OPS,type:q.STRING_OPS,model:q.STRING_OPS,provider:q.STRING_OPS},In={SPECIAL_FIELDS:["usage","metadata","feedback_scores"],USAGE_KEYS:["total_tokens","prompt_tokens","completion_tokens"]};function Yh(n){let o=In.SPECIAL_FIELDS.includes(n),e=Object.keys($e).includes(n);if(!o&&!e){let t=Object.keys($e).join(", ");throw new Error(`Field ${n} is not supported, only the fields ${t} are supported.`)}}function Xh(n,o){if(!In.SPECIAL_FIELDS.includes(n)){let e=Object.keys($e).join(", ");throw new Error(`Field ${n}.${o} is not supported, only the fields ${e} are supported.`)}if(n==="usage"&&!In.USAGE_KEYS.includes(o))throw new Error(`When querying usage, ${o} is not supported, only usage.total_tokens, usage.prompt_tokens and usage.completion_tokens are supported.`)}function Bu(n,o){let e=Qh[n];if(!(e!=null&&e.includes(o))){let t=(e==null?void 0:e.join(", "))||"none";throw new Error(`Operator ${o} is not supported for field ${n}, only the operators ${t} are supported.`)}}function Zh(n){let o=n.toLowerCase();if(o==="and")return true;throw o==="or"?new Error("Invalid filter string, OR is not currently supported"):new Error(`Invalid filter string, trailing characters ${n}`)}function Dn(n,o,e){if(!n)throw new Error(`Missing closing quote for: ${e}`)}var Ri=class{static parse(o){o.skipWhitespace();let e=this.parseFieldName(o);return Yh(e),o.peekChar()==="."?this.parseFieldWithKey(o,e):{type:"simple",field:e,columnType:$e[e]}}static parseFieldName(o){return o.consumeWhile(e=>ue.isFieldChar(e))}static parseFieldWithKey(o,e){o.advance();let t=this.parseKey(o);if(Xh(e,t),e==="usage"){let i=`usage.${t}`;return {type:"simple",field:i,columnType:$e[i]}}return {type:"nested",field:e,key:t,columnType:$e[e]}}static parseKey(o){let e=o.peekChar();return ue.isQuoteChar(e)?this.parseQuotedKey(o,e):this.parseUnquotedKey(o)}static parseUnquotedKey(o){return o.consumeWhile(e=>ue.isFieldChar(e))}static parseQuotedKey(o,e){let t=o.getPosition();o.advance();let i="",a=false;for(;!o.isAtEnd();){let p=o.peekChar();if(p===e){if(o.peekCharAt(1)===e){i+=e,o.advance(2);continue}a=true,o.advance();break}i+=p,o.advance();}let s=o.getFullInput().slice(t);return Dn(a,t,s),i}};var wi=class{static parse(o,e){o.skipWhitespace();let t=o.peekChar(),i=this.tryParseSymbolicOperator(o,t);if(i)return Bu(e,i),{operator:i};let a=this.parseWordOperator(o);return Bu(e,a),{operator:a}}static tryParseSymbolicOperator(o,e){if(e==="=")return o.advance(),"=";if(e==="<"||e===">"){let t=e;return o.advance(),o.peekChar()==="="?(o.advance(),t+"="):t}return e==="!"&&o.peekCharAt(1)==="="?(o.advance(2),"!="):null}static parseWordOperator(o){return o.consumeWhile(e=>!ue.isWhitespaceChar(e))}};var _i=class{static parse(o){o.skipWhitespace();let e=o.getPosition(),t=o.peekChar();if(t==='"')return this.parseQuotedString(o,e);if(ue.isDigitChar(t)||t==="-")return this.parseNumber(o);let i=o.getRemainingInput();throw new Error(`Invalid value ${i.slice(0,20)}, expected a string in double quotes("value") or a number`)}static parseQuotedString(o,e){o.advance();let t=o.getPosition(),i=false;for(;!o.isAtEnd();){if(o.peekChar()==='"'){i=true;break}o.advance();}Dn(i,e,`value starting at position ${e}`);let a=o.sliceFrom(t);return o.advance(),{value:a}}static parseNumber(o){let e="";return o.peekChar()==="-"&&(e+=o.consumeChar()),e+=this.parseDigits(o),o.peekChar()==="."&&(e+=o.consumeChar(),e+=this.parseDigits(o)),{value:e}}static parseDigits(o){return o.consumeWhile(e=>ue.isDigitChar(e))}};var Qe=class{constructor(o){let e=o||"";this.filterExpressions=e?this.parse(e):null,this.parsedFilters=this.filterExpressions?JSON.stringify(this.filterExpressions):null;}getFilterExpressions(){return this.filterExpressions}parse(o){let e=new ue(o),t=[];for(;!e.isAtEnd();){let i=this.parseExpression(e);if(t.push(i),e.skipWhitespace(),!e.isAtEnd()&&!this.parseConnector(e))break}return t}parseExpression(o){let e=Ri.parse(o),t=wi.parse(o,this.getFieldName(e)),i=_i.parse(o);return this.buildExpression(e,t,i)}getFieldName(o){return o.field}buildExpression(o,e,t){let i={field:o.field,operator:e.operator,value:t.value,type:o.columnType};return o.type==="nested"&&(i.key=o.key),i}parseConnector(o){let e=o.getPosition(),t=o.consumeWhile(i=>ue.isLetterChar(i));try{return Zh(t)}catch(i){if(i instanceof Error&&i.message.includes("trailing characters")){let a=o.getFullInput().slice(e);throw new Error(`Invalid filter string, trailing characters ${a}`)}throw i}}};async function Oh(n,o,e,t,i){let a=await n.traces.searchTraces({projectName:o,filters:e!=null?e:void 0,limit:t,truncate:i});return await Ge(a,H.TracePublic,t)}async function qh(n,o,e,t){let i=Date.now(),a=[];for(;;){if(a=await n(),a.length>=o||Date.now()-i>=e)return a;await new Promise(p=>setTimeout(p,t));}}function eg(n){if(!n)return null;let e=new Qe(n).getFilterExpressions();return e?e.map(t=>{let i={field:t.field,operator:t.operator,value:t.value};return t.key&&(i.key=t.key),i}):null}var Vu=[],zr=class{constructor(o){this.displayTraceLog=o=>{if(o===this.lastProjectNameLogged||!this.config.apiUrl)return;let e=Nh({apiUrl:this.config.apiUrl,projectName:o,workspaceName:this.config.workspaceName});j.info(`Started logging traces to the "${o}" project at ${Ti(e)}`),this.lastProjectNameLogged=o;};this.trace=o=>{var i;j.debug("Creating new trace with data:",o);let e=(i=o.projectName)!=null?i:this.config.projectName,t=new fn({id:ae(),startTime:new Date,...o,projectName:e},this);return this.traceBatchQueue.create(t.data),j.debug("Trace added to the queue with ID:",t.data.id),this.displayTraceLog(e),t};this.getDataset=async o=>{j.debug(`Getting dataset with name "${o}"`);try{await this.datasetBatchQueue.flush();let e=await this.api.datasets.getDatasetByIdentifier({datasetName:o});return new $r(e,this)}catch(e){throw e instanceof w&&e.statusCode===404?new gi(o):e}};this.createDataset=async(o,e)=>{j.debug(`Creating dataset with name "${o}"`);let t=new $r({name:o,description:e},this);try{return this.datasetBatchQueue.create({name:t.name,description:t.description,id:t.id}),j.debug("Dataset added to the queue with name:",t.name),t}catch(i){throw j.error(`Failed to create dataset "${o}"`,{error:i}),new Error(`Error creating dataset "${o}": ${i}`)}};this.getOrCreateDataset=async(o,e)=>{j.debug(`Attempting to retrieve or create dataset with name: "${o}"`);try{return await this.getDataset(o)}catch(t){if(t instanceof gi)return j.info(`Dataset "${o}" not found. Proceeding to create a new one.`),this.createDataset(o,e);throw j.error(`Error retrieving dataset "${o}":`,t),t}};this.getDatasets=async(o=100)=>{j.debug(`Getting all datasets (limit: ${o})`);try{await this.datasetBatchQueue.flush();let e=await this.api.datasets.findDatasets({size:o}),t=[];for(let i of e.content||[])t.push(new $r(i,this));return j.info(`Retrieved ${t.length} datasets`),t}catch(e){throw j.error("Failed to retrieve datasets",{error:e}),new Error("Failed to retrieve datasets")}};this.deleteDataset=async o=>{j.debug(`Deleting dataset with name "${o}"`);try{let e=await this.getDataset(o);if(!e.id)throw new Error(`Cannot delete dataset "${o}": ID not available`);this.datasetBatchQueue.delete(e.id);}catch(e){throw j.error(`Failed to delete dataset "${o}"`,{error:e}),new Error(`Failed to delete dataset "${o}": ${e}`)}};this.createExperiment=async({datasetName:o,name:e,experimentConfig:t,prompts:i,type:a=ls.Regular,optimizationId:s})=>{if(j.debug(`Creating experiment for dataset "${o}"`),!o)throw new Error("Dataset name is required to create an experiment");let[p,l]=Bh(t,i),c=ae(),d=new Rr({id:c,name:e,datasetName:o,prompts:i},this);try{return this.api.experiments.createExperiment({id:c,datasetName:o,name:e,metadata:p,promptVersions:l,type:a,optimizationId:s}),j.debug("Experiment added to the queue with id:",c),d}catch(m){throw j.error(`Failed to create experiment for dataset "${o}"`,{error:m}),new Error(`Error creating experiment: ${m}`)}};this.updateExperiment=async(o,e)=>{if(!o)throw new Error("id is required to update an experiment");let{name:t,experimentConfig:i}=e;if(!t&&!i)throw new Error("At least one of 'name' or 'experimentConfig' must be provided to update an experiment");j.debug(`Updating experiment with ID "${o}"`);let a={};t!==void 0&&(a.name=t),i!==void 0&&(a.metadata=i);try{await this.api.experiments.updateExperiment(o,{body:a});}catch(s){throw j.error(`Failed to update experiment with ID "${o}"`,{error:s}),s}};this.getExperimentById=async o=>{j.debug(`Getting experiment with ID "${o}"`);try{let e=await this.api.experiments.getExperimentById(o);return new Rr({id:e.id,name:e.name,datasetName:e.datasetName},this)}catch(e){throw e instanceof w&&e.statusCode===404?new yi(`No experiment found with ID '${o}'`):(j.error(`Failed to get experiment with ID "${o}"`,{error:e}),e)}};this.getExperimentsByName=async o=>{j.debug(`Getting experiments with name "${o}"`);try{let e=await this.api.experiments.streamExperiments({name:o});return (await Ge(e,H.ExperimentPublic)).map(i=>new Rr({id:i.id,name:i.name,datasetName:i.datasetName},this))}catch(e){throw j.error(`Failed to get experiments with name "${o}"`,{error:e}),e}};this.getExperiment=async o=>{j.debug(`Getting experiment with name "${o}"`);let e=await this.getExperimentsByName(o);if(e.length===0)throw new yi(o);return e[0]};this.getDatasetExperiments=async(o,e=100)=>{var s;j.debug(`Getting experiments for dataset "${o}"`);let t=await this.getDataset(o),i=Math.min(100,e),a=[];try{let p=1;for(;a.length<e;){let l=await this.api.experiments.findExperiments({page:p,size:i,datasetId:t.id}),c=(s=l==null?void 0:l.content)!=null?s:[];if(c.length===0)break;let d=e-a.length,m=Math.min(c.length,d);for(let f=0;f<m;f++){let u=c[f];a.push(new Rr({id:u.id,name:u.name,datasetName:u.datasetName},this));}if(m<c.length)break;p+=1;}return a}catch(p){throw j.error(`Failed to get experiments for dataset "${o}"`,{error:p}),p}};this.deleteExperiment=async o=>{j.debug(`Deleting experiment with ID "${o}"`);try{await this.api.experiments.deleteExperimentsById({ids:[o]});}catch(e){throw j.error(`Failed to delete experiment with ID "${o}"`,{error:e}),e}};this.createPromptInternal=async(o,e,t,i,a,s,p)=>{var l;j.debug(`Creating ${p}`,{name:o});try{let c=await Kh(this.api.prompts,o,this.api.requestOptions);a(c);let d=(l=i.type)!=null?l:Re.MUSTACHE,m=$h({prompt:e,metadata:i.metadata},c,d),f;if(m?(j.debug(`Creating new ${p} version`,{name:o}),f=await this.api.prompts.createPromptVersion({name:o,version:{template:e,metadata:i.metadata,type:d},templateStructure:t},this.api.requestOptions)):(j.debug(`Returning existing ${p} version`,{name:o}),f=c),!f.promptId)throw new Error("Invalid API response: missing promptId");let u=await this.api.prompts.getPromptById(f.promptId,this.api.requestOptions),h=s(u,f);return j.debug(`${p} created`,{name:o}),i.description||i.tags?await h.updateProperties({description:i.description,tags:i.tags}):h}catch(c){throw j.error(`Failed to create ${p}`,{name:o,error:c}),c}};this.createPrompt=async o=>this.createPromptInternal(o.name,o.prompt,ce.Text,o,()=>{},(e,t)=>Ke.fromApiResponse(e,t,this),"prompt");this.createChatPrompt=async o=>{let e=JSON.stringify(o.messages);return this.createPromptInternal(o.name,e,ce.Chat,o,t=>{if(t&&t.templateStructure&&t.templateStructure!==ce.Chat)throw new wr(o.name,t.templateStructure,ce.Chat)},(t,i)=>_r.fromApiResponse(t,i,this),"chat prompt")};this.getPrompt=async o=>{var e;j.debug("Getting prompt",o);try{let i=(e=(await this.api.prompts.getPrompts({filters:JSON.stringify([{field:"name",operator:"=",value:o.name}]),size:1},this.api.requestOptions)).content)==null?void 0:e[0];if(!i)return j.debug("Prompt not found",{name:o.name}),null;let a=await this.api.prompts.retrievePromptVersion(o,this.api.requestOptions),s=a.templateStructure;if(s&&s!==ce.Text)throw new wr(o.name,s,ce.Text);return Ke.fromApiResponse(i,a,this)}catch(t){if(t instanceof w&&t.statusCode===404)return null;throw j.error("Failed to get prompt",{name:o.name,error:t}),t}};this.getChatPrompt=async o=>{var e;j.debug("Getting chat prompt",o);try{let i=(e=(await this.api.prompts.getPrompts({filters:JSON.stringify([{field:"name",operator:"=",value:o.name}]),size:1},this.api.requestOptions)).content)==null?void 0:e[0];if(!i)return j.debug("Chat prompt not found",{name:o.name}),null;let a=await this.api.prompts.retrievePromptVersion(o,this.api.requestOptions),s=a.templateStructure;if(!s||s!==ce.Chat)throw new wr(o.name,s!=null?s:"undefined",ce.Chat);return _r.fromApiResponse(i,a,this)}catch(t){if(t instanceof w&&t.statusCode===404)return null;throw j.error("Failed to get chat prompt",{name:o.name,error:t}),t}};this.searchPrompts=async o=>{var e;j.debug("Searching prompts",{filterString:o});try{let t;if(o){let l=new Qe(o).getFilterExpressions();t=l?JSON.stringify(l):void 0;}let a=(e=(await this.api.prompts.getPrompts({filters:t,size:1e3},this.api.requestOptions)).content)!=null?e:[];return (await Promise.all(a.map(async p=>{if(!p.name)return null;try{let l=await this.api.prompts.retrievePromptVersion({name:p.name},this.api.requestOptions),c=l.templateStructure;return !c||c===ce.Text?Ke.fromApiResponse(p,l,this):c===ce.Chat?_r.fromApiResponse(p,l,this):null}catch(l){return j.debug("Failed to get version for prompt",{name:p.name,error:l}),null}}))).filter(p=>p!==null)}catch(t){throw j.error("Failed to search prompts",{error:t}),t}};this.deletePrompts=async o=>{j.debug("Deleting prompts in batch",{count:o.length});try{await this.api.prompts.deletePromptsBatch({ids:o},this.api.requestOptions),j.info("Successfully deleted prompts",{count:o.length});}catch(e){throw j.error("Failed to delete prompts",{count:o.length,error:e}),e}};this.searchTraces=async o=>{let{projectName:e,filterString:t,maxResults:i=1e3,truncate:a=true,waitForAtLeast:s,waitForTimeout:p=60}=o!=null?o:{};j.debug("Searching traces",{projectName:e,filterString:t,maxResults:i,truncate:a,waitForAtLeast:s,waitForTimeout:p});let l=eg(t),c=e!=null?e:this.config.projectName,d=()=>Oh(this.api,c,l,i,a);if(s===void 0)return await d();let m=await qh(d,s,p*1e3,5e3);if(m.length<s)throw new kn(`Timeout after ${p} seconds: expected ${s} traces, but only ${m.length} were found.`);return m};this.flush=async()=>{j.debug("Starting flush operation");try{await this.traceBatchQueue.flush(),await this.spanBatchQueue.flush(),await this.traceFeedbackScoresBatchQueue.flush(),await this.spanFeedbackScoresBatchQueue.flush(),await this.datasetBatchQueue.flush(),j.info("Successfully flushed all data to Opik");}catch(o){j.error("Error during flush operation:",{error:o instanceof Error?o.message:o});}};this.updatePromptVersionTags=async(o,e)=>{var t;j.debug("Updating prompt version tags",{count:o.length,options:e});try{await this.api.prompts.updatePromptVersions({ids:o,update:{tags:(t=e==null?void 0:e.tags)!=null?t:void 0},mergeTags:e==null?void 0:e.mergeTags},this.api.requestOptions),j.debug("Successfully updated prompt version tags",{count:o.length});}catch(i){throw j.error("Failed to update prompt version tags",{count:o.length,error:i}),i}};j.debug("Initializing OpikClient with config:",o),this.config=lf(o);let e={apiKey:this.config.apiKey,environment:this.config.apiUrl,workspaceName:this.config.workspaceName};o!=null&&o.headers&&(j.debug("Initializing OpikClient with additional headers:",o==null?void 0:o.headers),e.requestOptions={headers:o==null?void 0:o.headers}),this.api=new wn(e);let t=this.config.holdUntilFlush?1440*60*1e3:this.config.batchDelayMs;this.spanBatchQueue=new yn(this.api,t),this.traceBatchQueue=new xn(this.api,t),this.spanFeedbackScoresBatchQueue=new bn(this.api,t),this.traceFeedbackScoresBatchQueue=new Rn(this.api,t),this.datasetBatchQueue=new _n(this.api,t),Vu.push(this);}};var zR="track.decorator",zi=new async_hooks.AsyncLocalStorage,kR=()=>{let{span:n,trace:o}=zi.getStore()||{};if(!(!n||!o))return {span:n,trace:o}};function SR(n){return !!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function PR({name:n,parentSpan:o,projectName:e,trace:t,type:i="llm"}){j.debug("Creating new span:",{name:n,parentSpan:o==null?void 0:o.data.id,projectName:e,type:i});let a=t;a||(a=Hu().trace({name:n,projectName:e}));let s=a.span({name:n,parentSpanId:o==null?void 0:o.data.id,projectName:e,type:i});return j.debug("Span created with ID:",s.data.id),{span:s,trace:a}}function AR({args:n,span:o,trace:e}){if(j.debug("Starting span execution:",{spanId:o.data.id,traceId:e==null?void 0:e.data.id}),n.length===0)return;let t={arguments:n};j.debug("Recording span input"),o.update({input:t}),e&&(j.debug("Recording trace input"),e.update({input:t}));}function rg({result:n,span:o,trace:e,enrichSpan:t}){j.debug("Recording successful execution:",{spanId:o.data.id,traceId:e==null?void 0:e.data.id});let i=typeof n=="object"?n:{result:n},a=new Date,s={endTime:a,output:i};if(t){let p=t(n);Object.assign(s,p);}o.update(s),e&&e.update({endTime:a,output:i});}function tg({span:n,error:o,trace:e}){var t,i;j.error("Recording execution error:",{spanId:n.data.id,traceId:e==null?void 0:e.data.id,error:o instanceof Error?{name:o.name,message:o.message,stack:o.stack}:o}),o instanceof Error&&n.update({errorInfo:{message:o.message,exceptionType:o.name,traceback:(t=o.stack)!=null?t:""}}),n.end(),e&&(e.update({errorInfo:{message:o.message,exceptionType:o.name,traceback:(i=o.stack)!=null?i:""}}),e.end());}function Un({name:n,projectName:o,type:e,enrichSpan:t}={},i){return function(...s){let p=zi.getStore(),{span:l,trace:c}=PR({name:n!=null?n:i.name||zR,parentSpan:p==null?void 0:p.span,projectName:o,trace:p==null?void 0:p.trace,type:e}),d=!p,m=this;return zi.run({span:l,trace:c},()=>{let f=d?c:void 0;try{AR({args:s,span:l,trace:f});let u=i.apply(m,s);return SR(u)?u.then(h=>(rg({span:l,result:h,trace:f,enrichSpan:t}),h),h=>{throw tg({span:l,error:h,trace:f}),h}):(rg({span:l,result:u,trace:f,enrichSpan:t}),u)}catch(u){throw tg({span:l,error:u,trace:f}),u}})}}function Ye(n,o){if(typeof n=="function")return Un({},n);let e=n;return o?Un(e,o):function(...t){if(t.length===2&&typeof t[1]=="object"&&t[1]!==null&&"kind"in t[1]){let[s,p]=t;if(p.kind!=="method")throw new Error("track decorator is only applicable to methods");return Un(e,s)}let[,,i]=t;if(!i||typeof i.value!="function")throw new Error("track decorator can only be applied to methods");let a=i.value;return i.value=Un(e,a),i}}var Lu=null;function Hu(){return Lu===null&&(Lu=new zr),Lu}var TR=async()=>{j.debug("Starting flushAll operation");try{await Promise.all([Hu().flush(),...Vu.map(n=>n.flush())]),j.debug("flushAll operation completed successfully");}catch(n){throw j.error("Error during flushAll operation:",{error:n instanceof Error?n.message:n,stack:n instanceof Error?n.stack:void 0}),n}};function og(n,o){if(!o||typeof o!="object")throw new Error("Arguments must be an object");let e=n.validationSchema,i=e.extend(Object.fromEntries(Object.entries(e.shape).map(([a,s])=>[a,s.refine(p=>p!==void 0,{message:`${a} cannot be undefined`,path:[a]})]))).safeParse(o);if(!i.success){let a=i.error.issues.map(p=>p.path[0]).filter(Boolean),s=[...new Set(a)];throw new Error(vR(n,o,s))}}function vR(n,o,e){let t=Object.keys(o),i=e.filter(a=>!(a in o));return `Metric '${n.name}' is skipped, missing required arguments: ${i.join(", ")}. Available arguments: ${t.join(", ")}.`}var Nn=class{static calculateAverageScores(o){if(!o||o.length===0)return new Map;let e=new Map;for(let i of o)if(!(!i||!i.scoreResults||i.scoreResults.length===0))for(let a of i.scoreResults){if(!a||a.scoringFailed||typeof a.value!="number")continue;let s=e.get(a.name)||{sum:0,count:0};s.sum+=a.value,s.count+=1,e.set(a.name,s);}let t=new Map;return e.forEach((i,a)=>{t.set(a,i.count>0?i.sum/i.count:0);}),t}static formatScore(o){return o.toFixed(4)}static formatTime(o){let e=Math.floor(o/3600),t=Math.floor(o%3600/60),i=Math.floor(o%60);return `${e.toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`}static async generateResultTable(o,e,t,i){if(o.length===0){j.info(`
|
|
17
|
+
`)}return i.length===1&&i[0].type==="text"?i[0].text:i}};var _r=class n extends Qr{constructor(o,e){super({...o,templateStructure:ce.Chat},e),this.messages=o.messages,this.chatTemplate=new Dn(o.messages,this.type);}get template(){return structuredClone(this.messages)}format(o,e){return this.chatTemplate.format(o,e)}static fromApiResponse(o,e,t){var s;if(!e.template)throw new G("Invalid API response: missing required field 'template'");if(!e.commit)throw new G("Invalid API response: missing required field 'commit'");if(!e.promptId)throw new G("Invalid API response: missing required field 'promptId'");if(!e.id)throw new G("Invalid API response: missing required field 'id' (version ID)");let i;try{if(i=JSON.parse(e.template),!Array.isArray(i))throw new G("Invalid chat prompt template: expected array of messages")}catch(p){throw p instanceof G?p:new G(`Failed to parse chat prompt template: ${p instanceof Error?p.message:String(p)}`)}let a=(s=e.type)!=null?s:Re.MUSTACHE;if(a!=="mustache"&&a!=="jinja2")throw new G(`Invalid API response: unknown prompt type '${a}'`);return new n({promptId:e.promptId,versionId:e.id,name:o.name,messages:i,commit:e.commit,metadata:e.metadata,type:a,changeDescription:e.changeDescription,description:o.description,tags:o.tags},t)}async useVersion(o){var t;let e=await this.restoreVersion(o);return n.fromApiResponse({name:this.name,description:this.description,tags:Array.from((t=this.tags)!=null?t:[])},e,this.opik)}async getVersion(o){var t;let e=await this.retrieveVersionByCommit(o);return e?n.fromApiResponse({name:this.name,description:this.description,tags:Array.from((t=this.tags)!=null?t:[])},e,this.opik):null}};async function $h(n,o,e){try{return await n.retrievePromptVersion({name:o},e)}catch(t){if(_R(t))return null;throw t}}function Qh(n,o,e){return o?o.template!==n.prompt||!wR(o.metadata,n.metadata)||o.type!==e:true}function wR(n,o){let e=n!=null?n:{},t=o!=null?o:{};return RR__default.default(e,t)}function _R(n){return typeof n=="object"&&n!==null&&"statusCode"in n&&n.statusCode===404}var ue=class{constructor(o){this.input=o;this.cursor=0;}getPosition(){return this.cursor}getRemainingInput(){return this.input.slice(this.cursor)}getFullInput(){return this.input}isAtEnd(){return this.cursor>=this.input.length}peekChar(){return this.input[this.cursor]}peekCharAt(o){return this.input[this.cursor+o]}consumeChar(){return this.input[this.cursor++]}advance(o=1){this.cursor+=o;}skipWhitespace(){for(;this.cursor<this.input.length&&/\s/.test(this.input[this.cursor]);)this.cursor++;}consumeWhile(o){let e=this.cursor;for(;this.cursor<this.input.length&&o(this.input[this.cursor]);)this.cursor++;return this.input.slice(e,this.cursor)}sliceFrom(o){return this.input.slice(o,this.cursor)}static isFieldChar(o){return /[a-zA-Z0-9_]/.test(o)}static isLetterChar(o){return /[a-zA-Z]/.test(o)}static isDigitChar(o){return /\d/.test(o)}static isWhitespaceChar(o){return /\s/.test(o)}static isQuoteChar(o){return o==='"'||o==="'"}};var q={STRING_OPS:["=","contains","not_contains","starts_with","ends_with","!=",">","<"],NUMERIC_OPS:["=","!=",">","<",">=","<="],DATETIME_OPS:["=",">","<",">=","<="],LIST_OPS:["contains"],DICT_OPS:["=","contains",">","<"],LIMITED_STRING_OPS:["=","contains","not_contains"]},$e={id:"string",name:"string",status:"string",start_time:"date_time",end_time:"date_time",input:"string",output:"string",metadata:"dictionary",feedback_scores:"feedback_scores_number",tags:"list","usage.total_tokens":"number","usage.prompt_tokens":"number","usage.completion_tokens":"number",duration:"number",number_of_messages:"number",created_by:"string",thread_id:"string",total_estimated_cost:"number",type:"string",model:"string",provider:"string"},Yh={id:q.STRING_OPS,name:q.STRING_OPS,status:q.LIMITED_STRING_OPS,start_time:q.DATETIME_OPS,end_time:q.DATETIME_OPS,input:q.LIMITED_STRING_OPS,output:q.LIMITED_STRING_OPS,metadata:q.DICT_OPS,feedback_scores:q.NUMERIC_OPS,tags:q.LIST_OPS,"usage.total_tokens":q.NUMERIC_OPS,"usage.prompt_tokens":q.NUMERIC_OPS,"usage.completion_tokens":q.NUMERIC_OPS,duration:q.NUMERIC_OPS,number_of_messages:q.NUMERIC_OPS,created_by:q.STRING_OPS,thread_id:q.STRING_OPS,total_estimated_cost:q.NUMERIC_OPS,type:q.STRING_OPS,model:q.STRING_OPS,provider:q.STRING_OPS},Un={SPECIAL_FIELDS:["usage","metadata","feedback_scores"],USAGE_KEYS:["total_tokens","prompt_tokens","completion_tokens"]};function Xh(n){let o=Un.SPECIAL_FIELDS.includes(n),e=Object.keys($e).includes(n);if(!o&&!e){let t=Object.keys($e).join(", ");throw new Error(`Field ${n} is not supported, only the fields ${t} are supported.`)}}function Zh(n,o){if(!Un.SPECIAL_FIELDS.includes(n)){let e=Object.keys($e).join(", ");throw new Error(`Field ${n}.${o} is not supported, only the fields ${e} are supported.`)}if(n==="usage"&&!Un.USAGE_KEYS.includes(o))throw new Error(`When querying usage, ${o} is not supported, only usage.total_tokens, usage.prompt_tokens and usage.completion_tokens are supported.`)}function Lu(n,o){let e=Yh[n];if(!(e!=null&&e.includes(o))){let t=(e==null?void 0:e.join(", "))||"none";throw new Error(`Operator ${o} is not supported for field ${n}, only the operators ${t} are supported.`)}}function Oh(n){let o=n.toLowerCase();if(o==="and")return true;throw o==="or"?new Error("Invalid filter string, OR is not currently supported"):new Error(`Invalid filter string, trailing characters ${n}`)}function Fn(n,o,e){if(!n)throw new Error(`Missing closing quote for: ${e}`)}var _i=class{static parse(o){o.skipWhitespace();let e=this.parseFieldName(o);return Xh(e),o.peekChar()==="."?this.parseFieldWithKey(o,e):{type:"simple",field:e,columnType:$e[e]}}static parseFieldName(o){return o.consumeWhile(e=>ue.isFieldChar(e))}static parseFieldWithKey(o,e){o.advance();let t=this.parseKey(o);if(Zh(e,t),e==="usage"){let i=`usage.${t}`;return {type:"simple",field:i,columnType:$e[i]}}return {type:"nested",field:e,key:t,columnType:$e[e]}}static parseKey(o){let e=o.peekChar();return ue.isQuoteChar(e)?this.parseQuotedKey(o,e):this.parseUnquotedKey(o)}static parseUnquotedKey(o){return o.consumeWhile(e=>ue.isFieldChar(e))}static parseQuotedKey(o,e){let t=o.getPosition();o.advance();let i="",a=false;for(;!o.isAtEnd();){let p=o.peekChar();if(p===e){if(o.peekCharAt(1)===e){i+=e,o.advance(2);continue}a=true,o.advance();break}i+=p,o.advance();}let s=o.getFullInput().slice(t);return Fn(a,t,s),i}};var zi=class{static parse(o,e){o.skipWhitespace();let t=o.peekChar(),i=this.tryParseSymbolicOperator(o,t);if(i)return Lu(e,i),{operator:i};let a=this.parseWordOperator(o);return Lu(e,a),{operator:a}}static tryParseSymbolicOperator(o,e){if(e==="=")return o.advance(),"=";if(e==="<"||e===">"){let t=e;return o.advance(),o.peekChar()==="="?(o.advance(),t+"="):t}return e==="!"&&o.peekCharAt(1)==="="?(o.advance(2),"!="):null}static parseWordOperator(o){return o.consumeWhile(e=>!ue.isWhitespaceChar(e))}};var ki=class{static parse(o){o.skipWhitespace();let e=o.getPosition(),t=o.peekChar();if(t==='"')return this.parseQuotedString(o,e);if(ue.isDigitChar(t)||t==="-")return this.parseNumber(o);let i=o.getRemainingInput();throw new Error(`Invalid value ${i.slice(0,20)}, expected a string in double quotes("value") or a number`)}static parseQuotedString(o,e){o.advance();let t=o.getPosition(),i=false;for(;!o.isAtEnd();){if(o.peekChar()==='"'){i=true;break}o.advance();}Fn(i,e,`value starting at position ${e}`);let a=o.sliceFrom(t);return o.advance(),{value:a}}static parseNumber(o){let e="";return o.peekChar()==="-"&&(e+=o.consumeChar()),e+=this.parseDigits(o),o.peekChar()==="."&&(e+=o.consumeChar(),e+=this.parseDigits(o)),{value:e}}static parseDigits(o){return o.consumeWhile(e=>ue.isDigitChar(e))}};var Qe=class{constructor(o){let e=o||"";this.filterExpressions=e?this.parse(e):null,this.parsedFilters=this.filterExpressions?JSON.stringify(this.filterExpressions):null;}getFilterExpressions(){return this.filterExpressions}parse(o){let e=new ue(o),t=[];for(;!e.isAtEnd();){let i=this.parseExpression(e);if(t.push(i),e.skipWhitespace(),!e.isAtEnd()&&!this.parseConnector(e))break}return t}parseExpression(o){let e=_i.parse(o),t=zi.parse(o,this.getFieldName(e)),i=ki.parse(o);return this.buildExpression(e,t,i)}getFieldName(o){return o.field}buildExpression(o,e,t){let i={field:o.field,operator:e.operator,value:t.value,type:o.columnType};return o.type==="nested"&&(i.key=o.key),i}parseConnector(o){let e=o.getPosition(),t=o.consumeWhile(i=>ue.isLetterChar(i));try{return Oh(t)}catch(i){if(i instanceof Error&&i.message.includes("trailing characters")){let a=o.getFullInput().slice(e);throw new Error(`Invalid filter string, trailing characters ${a}`)}throw i}}};async function qh(n,o,e,t,i){let a=await n.traces.searchTraces({projectName:o,filters:e!=null?e:void 0,limit:t,truncate:i});return await Ge(a,H.TracePublic,t)}async function eg(n,o,e,t){let i=Date.now(),a=[];for(;;){if(a=await n(),a.length>=o||Date.now()-i>=e)return a;await new Promise(p=>setTimeout(p,t));}}function rg(n){if(!n)return null;let e=new Qe(n).getFilterExpressions();return e?e.map(t=>{let i={field:t.field,operator:t.operator,value:t.value};return t.key&&(i.key=t.key),i}):null}var Hu=[],zr=class{constructor(o){this.displayTraceLog=o=>{if(o===this.lastProjectNameLogged||!this.config.apiUrl)return;let e=Mh({apiUrl:this.config.apiUrl,projectName:o,workspaceName:this.config.workspaceName});j.info(`Started logging traces to the "${o}" project at ${ji(e)}`),this.lastProjectNameLogged=o;};this.trace=o=>{var i;j.debug("Creating new trace with data:",o);let e=(i=o.projectName)!=null?i:this.config.projectName,t=new gn({id:ae(),startTime:new Date,...o,projectName:e},this);return this.traceBatchQueue.create(t.data),j.debug("Trace added to the queue with ID:",t.data.id),this.displayTraceLog(e),t};this.getDataset=async o=>{j.debug(`Getting dataset with name "${o}"`);try{await this.datasetBatchQueue.flush();let e=await this.api.datasets.getDatasetByIdentifier({datasetName:o});return new $r(e,this)}catch(e){throw e instanceof w&&e.statusCode===404?new bi(o):e}};this.createDataset=async(o,e)=>{j.debug(`Creating dataset with name "${o}"`);let t=new $r({name:o,description:e},this);try{return this.datasetBatchQueue.create({name:t.name,description:t.description,id:t.id}),j.debug("Dataset added to the queue with name:",t.name),t}catch(i){throw j.error(`Failed to create dataset "${o}"`,{error:i}),new Error(`Error creating dataset "${o}": ${i}`)}};this.getOrCreateDataset=async(o,e)=>{j.debug(`Attempting to retrieve or create dataset with name: "${o}"`);try{return await this.getDataset(o)}catch(t){if(t instanceof bi)return j.info(`Dataset "${o}" not found. Proceeding to create a new one.`),this.createDataset(o,e);throw j.error(`Error retrieving dataset "${o}":`,t),t}};this.getDatasets=async(o=100)=>{j.debug(`Getting all datasets (limit: ${o})`);try{await this.datasetBatchQueue.flush();let e=await this.api.datasets.findDatasets({size:o}),t=[];for(let i of e.content||[])t.push(new $r(i,this));return j.info(`Retrieved ${t.length} datasets`),t}catch(e){throw j.error("Failed to retrieve datasets",{error:e}),new Error("Failed to retrieve datasets")}};this.deleteDataset=async o=>{j.debug(`Deleting dataset with name "${o}"`);try{let e=await this.getDataset(o);if(!e.id)throw new Error(`Cannot delete dataset "${o}": ID not available`);this.datasetBatchQueue.delete(e.id);}catch(e){throw j.error(`Failed to delete dataset "${o}"`,{error:e}),new Error(`Failed to delete dataset "${o}": ${e}`)}};this.createExperiment=async({datasetName:o,name:e,experimentConfig:t,prompts:i,type:a=ds.Regular,optimizationId:s})=>{if(j.debug(`Creating experiment for dataset "${o}"`),!o)throw new Error("Dataset name is required to create an experiment");let[p,l]=Vh(t,i),c=ae(),d=new Rr({id:c,name:e,datasetName:o,prompts:i},this);try{return this.api.experiments.createExperiment({id:c,datasetName:o,name:e,metadata:p,promptVersions:l,type:a,optimizationId:s}),j.debug("Experiment added to the queue with id:",c),d}catch(m){throw j.error(`Failed to create experiment for dataset "${o}"`,{error:m}),new Error(`Error creating experiment: ${m}`)}};this.updateExperiment=async(o,e)=>{if(!o)throw new Error("id is required to update an experiment");let{name:t,experimentConfig:i}=e;if(!t&&!i)throw new Error("At least one of 'name' or 'experimentConfig' must be provided to update an experiment");j.debug(`Updating experiment with ID "${o}"`);let a={};t!==void 0&&(a.name=t),i!==void 0&&(a.metadata=i);try{await this.api.experiments.updateExperiment(o,{body:a});}catch(s){throw j.error(`Failed to update experiment with ID "${o}"`,{error:s}),s}};this.getExperimentById=async o=>{j.debug(`Getting experiment with ID "${o}"`);try{let e=await this.api.experiments.getExperimentById(o);return new Rr({id:e.id,name:e.name,datasetName:e.datasetName},this)}catch(e){throw e instanceof w&&e.statusCode===404?new xi(`No experiment found with ID '${o}'`):(j.error(`Failed to get experiment with ID "${o}"`,{error:e}),e)}};this.getExperimentsByName=async o=>{j.debug(`Getting experiments with name "${o}"`);try{let e=await this.api.experiments.streamExperiments({name:o});return (await Ge(e,H.ExperimentPublic)).map(i=>new Rr({id:i.id,name:i.name,datasetName:i.datasetName},this))}catch(e){throw j.error(`Failed to get experiments with name "${o}"`,{error:e}),e}};this.getExperiment=async o=>{j.debug(`Getting experiment with name "${o}"`);let e=await this.getExperimentsByName(o);if(e.length===0)throw new xi(o);return e[0]};this.getDatasetExperiments=async(o,e=100)=>{var s;j.debug(`Getting experiments for dataset "${o}"`);let t=await this.getDataset(o),i=Math.min(100,e),a=[];try{let p=1;for(;a.length<e;){let l=await this.api.experiments.findExperiments({page:p,size:i,datasetId:t.id}),c=(s=l==null?void 0:l.content)!=null?s:[];if(c.length===0)break;let d=e-a.length,m=Math.min(c.length,d);for(let f=0;f<m;f++){let u=c[f];a.push(new Rr({id:u.id,name:u.name,datasetName:u.datasetName},this));}if(m<c.length)break;p+=1;}return a}catch(p){throw j.error(`Failed to get experiments for dataset "${o}"`,{error:p}),p}};this.deleteExperiment=async o=>{j.debug(`Deleting experiment with ID "${o}"`);try{await this.api.experiments.deleteExperimentsById({ids:[o]});}catch(e){throw j.error(`Failed to delete experiment with ID "${o}"`,{error:e}),e}};this.createPromptInternal=async(o,e,t,i,a,s,p)=>{var l;j.debug(`Creating ${p}`,{name:o});try{let c=await $h(this.api.prompts,o,this.api.requestOptions);a(c);let d=(l=i.type)!=null?l:Re.MUSTACHE,m=Qh({prompt:e,metadata:i.metadata},c,d),f;if(m?(j.debug(`Creating new ${p} version`,{name:o}),f=await this.api.prompts.createPromptVersion({name:o,version:{template:e,metadata:i.metadata,type:d},templateStructure:t},this.api.requestOptions)):(j.debug(`Returning existing ${p} version`,{name:o}),f=c),!f.promptId)throw new Error("Invalid API response: missing promptId");let u=await this.api.prompts.getPromptById(f.promptId,this.api.requestOptions),h=s(u,f);return j.debug(`${p} created`,{name:o}),i.description||i.tags?await h.updateProperties({description:i.description,tags:i.tags}):h}catch(c){throw j.error(`Failed to create ${p}`,{name:o,error:c}),c}};this.createPrompt=async o=>this.createPromptInternal(o.name,o.prompt,ce.Text,o,()=>{},(e,t)=>Ke.fromApiResponse(e,t,this),"prompt");this.createChatPrompt=async o=>{let e=JSON.stringify(o.messages);return this.createPromptInternal(o.name,e,ce.Chat,o,t=>{if(t&&t.templateStructure&&t.templateStructure!==ce.Chat)throw new wr(o.name,t.templateStructure,ce.Chat)},(t,i)=>_r.fromApiResponse(t,i,this),"chat prompt")};this.getPrompt=async o=>{var e;j.debug("Getting prompt",o);try{let i=(e=(await this.api.prompts.getPrompts({filters:JSON.stringify([{field:"name",operator:"=",value:o.name}]),size:1},this.api.requestOptions)).content)==null?void 0:e[0];if(!i)return j.debug("Prompt not found",{name:o.name}),null;let a=await this.api.prompts.retrievePromptVersion(o,this.api.requestOptions),s=a.templateStructure;if(s&&s!==ce.Text)throw new wr(o.name,s,ce.Text);return Ke.fromApiResponse(i,a,this)}catch(t){if(t instanceof w&&t.statusCode===404)return null;throw j.error("Failed to get prompt",{name:o.name,error:t}),t}};this.getChatPrompt=async o=>{var e;j.debug("Getting chat prompt",o);try{let i=(e=(await this.api.prompts.getPrompts({filters:JSON.stringify([{field:"name",operator:"=",value:o.name}]),size:1},this.api.requestOptions)).content)==null?void 0:e[0];if(!i)return j.debug("Chat prompt not found",{name:o.name}),null;let a=await this.api.prompts.retrievePromptVersion(o,this.api.requestOptions),s=a.templateStructure;if(!s||s!==ce.Chat)throw new wr(o.name,s!=null?s:"undefined",ce.Chat);return _r.fromApiResponse(i,a,this)}catch(t){if(t instanceof w&&t.statusCode===404)return null;throw j.error("Failed to get chat prompt",{name:o.name,error:t}),t}};this.searchPrompts=async o=>{var e;j.debug("Searching prompts",{filterString:o});try{let t;if(o){let l=new Qe(o).getFilterExpressions();t=l?JSON.stringify(l):void 0;}let a=(e=(await this.api.prompts.getPrompts({filters:t,size:1e3},this.api.requestOptions)).content)!=null?e:[];return (await Promise.all(a.map(async p=>{if(!p.name)return null;try{let l=await this.api.prompts.retrievePromptVersion({name:p.name},this.api.requestOptions),c=l.templateStructure;return !c||c===ce.Text?Ke.fromApiResponse(p,l,this):c===ce.Chat?_r.fromApiResponse(p,l,this):null}catch(l){return j.debug("Failed to get version for prompt",{name:p.name,error:l}),null}}))).filter(p=>p!==null)}catch(t){throw j.error("Failed to search prompts",{error:t}),t}};this.deletePrompts=async o=>{j.debug("Deleting prompts in batch",{count:o.length});try{await this.api.prompts.deletePromptsBatch({ids:o},this.api.requestOptions),j.info("Successfully deleted prompts",{count:o.length});}catch(e){throw j.error("Failed to delete prompts",{count:o.length,error:e}),e}};this.searchTraces=async o=>{let{projectName:e,filterString:t,maxResults:i=1e3,truncate:a=true,waitForAtLeast:s,waitForTimeout:p=60}=o!=null?o:{};j.debug("Searching traces",{projectName:e,filterString:t,maxResults:i,truncate:a,waitForAtLeast:s,waitForTimeout:p});let l=rg(t),c=e!=null?e:this.config.projectName,d=()=>qh(this.api,c,l,i,a);if(s===void 0)return await d();let m=await eg(d,s,p*1e3,5e3);if(m.length<s)throw new Pn(`Timeout after ${p} seconds: expected ${s} traces, but only ${m.length} were found.`);return m};this.flush=async()=>{j.debug("Starting flush operation");try{await this.traceBatchQueue.flush(),await this.spanBatchQueue.flush(),await this.traceFeedbackScoresBatchQueue.flush(),await this.spanFeedbackScoresBatchQueue.flush(),await this.datasetBatchQueue.flush(),j.info("Successfully flushed all data to Opik");}catch(o){j.error("Error during flush operation:",{error:o instanceof Error?o.message:o});}};this.updatePromptVersionTags=async(o,e)=>{var t;j.debug("Updating prompt version tags",{count:o.length,options:e});try{await this.api.prompts.updatePromptVersions({ids:o,update:{tags:(t=e==null?void 0:e.tags)!=null?t:void 0},mergeTags:e==null?void 0:e.mergeTags},this.api.requestOptions),j.debug("Successfully updated prompt version tags",{count:o.length});}catch(i){throw j.error("Failed to update prompt version tags",{count:o.length,error:i}),i}};j.debug("Initializing OpikClient with config:",o),this.config=mf(o);let e={apiKey:this.config.apiKey,environment:this.config.apiUrl,workspaceName:this.config.workspaceName};o!=null&&o.headers&&(j.debug("Initializing OpikClient with additional headers:",o==null?void 0:o.headers),e.requestOptions={headers:o==null?void 0:o.headers}),this.api=new zn(e);let t=this.config.holdUntilFlush?1440*60*1e3:this.config.batchDelayMs;this.spanBatchQueue=new xn(this.api,t),this.traceBatchQueue=new wn(this.api,t),this.spanFeedbackScoresBatchQueue=new Rn(this.api,t),this.traceFeedbackScoresBatchQueue=new _n(this.api,t),this.datasetBatchQueue=new kn(this.api,t),Hu.push(this);}};var kR="track.decorator",Si=new async_hooks.AsyncLocalStorage,SR=()=>{let{span:n,trace:o}=Si.getStore()||{};if(!(!n||!o))return {span:n,trace:o}};function PR(n){return !!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function AR({name:n,parentSpan:o,projectName:e,trace:t,type:i="llm"}){j.debug("Creating new span:",{name:n,parentSpan:o==null?void 0:o.data.id,projectName:e,type:i});let a=t;a||(a=Gu().trace({name:n,projectName:e}));let s=a.span({name:n,parentSpanId:o==null?void 0:o.data.id,projectName:e,type:i});return j.debug("Span created with ID:",s.data.id),{span:s,trace:a}}function TR({args:n,span:o,trace:e}){if(j.debug("Starting span execution:",{spanId:o.data.id,traceId:e==null?void 0:e.data.id}),n.length===0)return;let t={arguments:n};j.debug("Recording span input"),o.update({input:t}),e&&(j.debug("Recording trace input"),e.update({input:t}));}function tg({result:n,span:o,trace:e,enrichSpan:t}){j.debug("Recording successful execution:",{spanId:o.data.id,traceId:e==null?void 0:e.data.id});let i=typeof n=="object"?n:{result:n},a=new Date,s={endTime:a,output:i};if(t){let p=t(n);Object.assign(s,p);}o.update(s),e&&e.update({endTime:a,output:i});}function og({span:n,error:o,trace:e}){var t,i;j.error("Recording execution error:",{spanId:n.data.id,traceId:e==null?void 0:e.data.id,error:o instanceof Error?{name:o.name,message:o.message,stack:o.stack}:o}),o instanceof Error&&n.update({errorInfo:{message:o.message,exceptionType:o.name,traceback:(t=o.stack)!=null?t:""}}),n.end(),e&&(e.update({errorInfo:{message:o.message,exceptionType:o.name,traceback:(i=o.stack)!=null?i:""}}),e.end());}function Nn({name:n,projectName:o,type:e,enrichSpan:t}={},i){return function(...s){let p=Si.getStore(),{span:l,trace:c}=AR({name:n!=null?n:i.name||kR,parentSpan:p==null?void 0:p.span,projectName:o,trace:p==null?void 0:p.trace,type:e}),d=!p,m=this;return Si.run({span:l,trace:c},()=>{let f=d?c:void 0;try{TR({args:s,span:l,trace:f});let u=i.apply(m,s);return PR(u)?u.then(h=>(tg({span:l,result:h,trace:f,enrichSpan:t}),h),h=>{throw og({span:l,error:h,trace:f}),h}):(tg({span:l,result:u,trace:f,enrichSpan:t}),u)}catch(u){throw og({span:l,error:u,trace:f}),u}})}}function Ye(n,o){if(typeof n=="function")return Nn({},n);let e=n;return o?Nn(e,o):function(...t){if(t.length===2&&typeof t[1]=="object"&&t[1]!==null&&"kind"in t[1]){let[s,p]=t;if(p.kind!=="method")throw new Error("track decorator is only applicable to methods");return Nn(e,s)}let[,,i]=t;if(!i||typeof i.value!="function")throw new Error("track decorator can only be applied to methods");let a=i.value;return i.value=Nn(e,a),i}}var Ju=null;function Gu(){return Ju===null&&(Ju=new zr),Ju}var vR=async()=>{j.debug("Starting flushAll operation");try{await Promise.all([Gu().flush(),...Hu.map(n=>n.flush())]),j.debug("flushAll operation completed successfully");}catch(n){throw j.error("Error during flushAll operation:",{error:n instanceof Error?n.message:n,stack:n instanceof Error?n.stack:void 0}),n}};function ig(n,o){if(!o||typeof o!="object")throw new Error("Arguments must be an object");let e=n.validationSchema,i=e.extend(Object.fromEntries(Object.entries(e.shape).map(([a,s])=>[a,s.refine(p=>p!==void 0,{message:`${a} cannot be undefined`,path:[a]})]))).safeParse(o);if(!i.success){let a=i.error.issues.map(p=>p.path[0]).filter(Boolean),s=[...new Set(a)];throw new Error(jR(n,o,s))}}function jR(n,o,e){let t=Object.keys(o),i=e.filter(a=>!(a in o));return `Metric '${n.name}' is skipped, missing required arguments: ${i.join(", ")}. Available arguments: ${t.join(", ")}.`}var Wn=class{static calculateAverageScores(o){if(!o||o.length===0)return new Map;let e=new Map;for(let i of o)if(!(!i||!i.scoreResults||i.scoreResults.length===0))for(let a of i.scoreResults){if(!a||a.scoringFailed||typeof a.value!="number")continue;let s=e.get(a.name)||{sum:0,count:0};s.sum+=a.value,s.count+=1,e.set(a.name,s);}let t=new Map;return e.forEach((i,a)=>{t.set(a,i.count>0?i.sum/i.count:0);}),t}static formatScore(o){return o.toFixed(4)}static formatTime(o){let e=Math.floor(o/3600),t=Math.floor(o%3600/60),i=Math.floor(o%60);return `${e.toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`}static async generateResultTable(o,e,t,i){if(o.length===0){j.info(`
|
|
18
18
|
No test results available to display.`);return}if(t.size===0){j.info(`
|
|
19
|
-
No metrics available to display.`);return}let a=[...t.keys()].sort(),s=this.formatTime(i),p=[
|
|
20
|
-
`),l=await e.ensureNameLoaded(),c=
|
|
19
|
+
No metrics available to display.`);return}let a=[...t.keys()].sort(),s=this.formatTime(i),p=[Mn__default.default.bold(`Total time: ${s}`),Mn__default.default.bold(`Number of samples: ${o.length}`),"",...a.map(d=>{let m=this.formatScore(t.get(d)||0);return Mn__default.default.green(`${d}: ${m} (avg)`)})].join(`
|
|
20
|
+
`),l=await e.ensureNameLoaded(),c=ER__default.default(p,{title:`${l} (${o.length} samples)`,titleAlignment:"left",padding:1,margin:0,borderColor:"cyan",borderStyle:"round"});j.info(`
|
|
21
21
|
`+c+`
|
|
22
|
-
`),j.info(
|
|
22
|
+
`),j.info(Mn__default.default.blue("Uploading results to Opik ... "));}static async displayExperimentLink(o){let e=await o.getUrl();j.info(`View the results ${ji(e,"in your Opik dashboard")}`);}static async processResults(o,e,t=0){let i=this.calculateAverageScores(o);await this.generateResultTable(o,e,i,t),await this.displayExperimentLink(e);let a=await e.ensureNameLoaded();return {experimentId:e.id,experimentName:a,testResults:o}}};function ag(n,o,e){if(!n||typeof o!="string"||o.trim()==="")return e;let t=o.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),i=n;for(let a of t)if(typeof i=="object"&&i!==null&&a in i)i=i[a];else return e;return i===void 0?e:i}var ng,Ku;ng=[Ye({name:"metrics_calculation",type:Ce.General})];var Yr=class{constructor(o,e,t){nf(Ku,5,this);this.client=void 0;this.dataset=void 0;this.task=void 0;this.scoringMetrics=void 0;this.projectName=void 0;this.nbSamples=void 0;this.scoringKeyMapping=void 0;this.experiment=void 0;this.rootTrace=void 0;this.client=e,this.dataset=o.dataset,this.experiment=t,this.task=o.task,this.scoringMetrics=o.scoringMetrics||[],this.projectName=o.projectName,this.nbSamples=o.nbSamples,this.scoringKeyMapping=o.scoringKeyMapping;}async execute(){var d;let o=performance.now(),e=[],t=await this.dataset.getItems(this.nbSamples),i=t.length,a=j.settings.minLevel;j.settings.minLevel=6;let s=CR__default.default({text:`Evaluating dataset (0/${i} items)`}).start(),p=[];for(let m=0;m<t.length;m++){let f=t[m];try{this.rootTrace=this.client.trace({projectName:this.projectName,name:"evaluation_task",createdBy:"evaluation",input:f}),Si.enterWith({trace:this.rootTrace});let u=await this.executeTask(f);p.push(u),this.rootTrace.update({output:u.testCase.taskOutput,endTime:new Date});}catch(u){let h=u instanceof Error?u.message:String(u);j.error(`Error processing dataset item: ${f.id} - ${h}`),u instanceof Error&&this.rootTrace.update({errorInfo:{message:u.message,exceptionType:u.name,traceback:(d=u.stack)!=null?d:""},endTime:new Date});}e.push(new En({datasetItemId:f.id,traceId:this.rootTrace.data.id})),s.text=`Evaluating dataset (${m+1}/${i} items, ${Math.round((m+1)/i*100)}%)`;}let c=(performance.now()-o)/1e3;return s.succeed(`Evaluation complete: ${i} items processed in ${c.toFixed(2)}s`),j.settings.minLevel=a,this.experiment.insert(e),await this.client.flush(),Wn.processResults(p,this.experiment,c)}async executeTask(o){let e={},t=[];j.debug(`Starting evaluation task on dataset item ${o.id}`),e=await Ye({name:"llm_task",type:Ce.General},this.task)(o),j.debug(`Finished evaluation task on dataset item ${o.id}`);let i=this.prepareScoringInputs(o,e),a={traceId:this.rootTrace.data.id,datasetItemId:o.id,scoringInputs:i,taskOutput:e};return this.scoringMetrics.length>0?this.calculateScores(a):{testCase:a,scoreResults:t}}async calculateScores(o){let e=[],{scoringInputs:t}=o;for(let i of this.scoringMetrics){j.debug(`Calculating score for metric ${i.name}`);try{ig(i,t);let a=await i.score(t),s=Array.isArray(a)?a:[a];e.push(...s);}catch(a){let s=a instanceof Error?a.message:String(a);j.error(`Metric ${i.name} failed: ${s}`);}j.debug(`Finished calculating score for metric ${i.name}`);}return e.forEach(i=>{var a;return (a=this.rootTrace)==null?void 0:a.score({name:i.name,value:i.value,reason:i.reason})}),{testCase:o,scoreResults:e}}prepareScoringInputs(o,e){let t={...o,...e};if(!this.scoringKeyMapping)return t;let i={...t};for(let[a,s]of Object.entries(this.scoringKeyMapping)){let p=ag(t,s);p!==void 0&&(i[a]=p);}return i}};Ku=of(),sf(Ku,1,"calculateScores",ng,Yr),Qn(Ku,Yr);var Xr=class Xr{static getInstance(o){return Xr.instance||(Xr.instance=new zr(o)),Xr.instance}};Xr.instance=null;var Bn=Xr;async function sg(n){var t;if(!n.dataset)throw new Error("Dataset is required for evaluation");if(!n.task)throw new Error("Task function is required for evaluation");let o=(t=n.client)!=null?t:Bn.getInstance(),e=await o.createExperiment({name:n.experimentName,datasetName:n.dataset.name,experimentConfig:n.experimentConfig,prompts:n.prompts});try{let i=new Yr(n,o,e);return j.info("Starting evaluation"),i.execute()}catch(i){throw j.error(`Error during evaluation: ${i}`),i}}var kr=class{constructor(o){this.modelName=o;}};var Pi=class n extends Error{constructor(o){super(o),this.name="ModelError",Error.captureStackTrace&&Error.captureStackTrace(this,n);}},Zr=class n extends Pi{constructor(e,t){super(e);this.cause=t;this.name="ModelGenerationError",Error.captureStackTrace&&Error.captureStackTrace(this,n);}},Xe=class n extends Pi{constructor(o){super(o),this.name="ModelConfigurationError",Error.captureStackTrace&&Error.captureStackTrace(this,n);}};function FR(n,o){return n.startsWith("gpt-")||n.startsWith("o1")||n.startsWith("o3")||n.startsWith("chatgpt-")}function NR(n,o){return n.startsWith("claude-")}function MR(n,o){return n.startsWith("gemini-")||n.startsWith("gemma-")}function $u(n,o,e){if(!o)throw new Xe(`API key for ${n} is not configured. Please provide it via the 'apiKey' option or set the ${e} environment variable.`)}function Qu(n,o){if(FR(n)){let e=(o==null?void 0:o.apiKey)||process.env.OPENAI_API_KEY;return $u("OpenAI",e,"OPENAI_API_KEY"),openai.createOpenAI({apiKey:e,...o})(n)}if(NR(n)){let e=(o==null?void 0:o.apiKey)||process.env.ANTHROPIC_API_KEY;return $u("Anthropic",e,"ANTHROPIC_API_KEY"),anthropic.createAnthropic({apiKey:e,...o})(n)}if(MR(n)){let e=(o==null?void 0:o.apiKey)||process.env.GOOGLE_API_KEY;return $u("Google Gemini",e,"GOOGLE_API_KEY"),google.createGoogleGenerativeAI({apiKey:e,...o})(n)}throw new Xe(`Unable to detect provider for model ID: ${n}. Supported providers are OpenAI (gpt-*, o1*, o3*, chatgpt-*), Anthropic (claude-*), and Google Gemini (gemini-*, gemma-*).`)}var WR={inputTokens:"prompt_tokens",outputTokens:"completion_tokens",totalTokens:"total_tokens"};function BR(n){if(!n||typeof n!="object")return false;let o=n,e="usage"in o,t="response"in o,i="text"in o,a="object"in o;return e||t||i||a}function pg(n,o){if(!BR(n))return {model:o};let e={model:VR(n,o)},t=LR(n.usage);t&&(e.usage=t);let i=HR(n);i&&(e.provider=i);let a=GR(n);a&&(e.metadata=a);let s=KR(n);return s&&(e.output=s),e}function VR(n,o){var e,t;return (t=(e=n.response)==null?void 0:e.modelId)!=null?t:o}function LR(n){var i,a;if(!n)return;let o={};for(let[s,p]of Object.entries(WR)){let l=n[s];typeof l=="number"&&(o[p]=l);}let e=(i=n.inputTokenDetails)==null?void 0:i.cacheReadTokens;typeof e=="number"&&(o.cached_input_tokens=e);let t=(a=n.outputTokenDetails)==null?void 0:a.reasoningTokens;return typeof t=="number"&&(o.reasoning_tokens=t),Object.keys(o).length>0?o:void 0}function HR(n){if(!n.providerMetadata)return;let o=Object.keys(n.providerMetadata);return o.length>0?o[0]:void 0}function JR(n){if(!n)return;let o={};return n.id&&(o.id=n.id),n.timestamp&&(o.timestamp=n.timestamp.toISOString()),Object.keys(o).length>0?o:void 0}function GR(n){let o={};n.usage&&(o.usage=n.usage),n.warnings&&n.warnings.length>0&&(o.warnings=n.warnings);let e=JR(n.response);return e&&(o.response=e),n.providerMetadata&&(o.providerMetadata=n.providerMetadata),n.finishReason&&(o.finishReason=n.finishReason),Object.keys(o).length>0?o:void 0}function KR(n){let o={};return "text"in n&&n.text&&(o.text=n.text),"object"in n&&n.object!==void 0&&(o.object=n.object),"toolCalls"in n&&Array.isArray(n.toolCalls)&&(o.toolCalls=n.toolCalls),"toolResults"in n&&Array.isArray(n.toolResults)&&(o.toolResults=n.toolResults),"sources"in n&&Array.isArray(n.sources)&&(o.sources=n.sources),Object.keys(o).length>0?o:void 0}var Or=class extends kr{constructor(o,e={trackGenerations:true}){let t=typeof o=="string"?o:o.modelId;super(t);let{trackGenerations:i,...a}=e;try{typeof o!="string"?(this.model=o,j.debug("Initialized VercelAIChatModel with custom LanguageModel")):(this.model=Qu(o,a),j.debug(`Initialized VercelAIChatModel with model ID: ${o}`)),i?this._generateText=Ye({name:"model.generateText",type:Ce.Llm,enrichSpan:s=>pg(s,this.modelName)},ai$1.generateText):this._generateText=ai$1.generateText;}catch(s){throw new Xe(`Failed to initialize model ${t}: ${s instanceof Error?s.message:String(s)}`)}}async generateString(o,e,t){try{let i;if(e){j.debug(`Generating structured output with model ${this.modelName}, input length: ${o.length}`);let a=await this._generateText({model:this.model,prompt:o,output:ai$1.Output.object({schema:e}),...t});j.debug(`Generated structured output with model ${this.modelName}`),i=JSON.stringify(a.output);}else {j.debug(`Generating text with model ${this.modelName}, input length: ${o.length}`);let a=await this._generateText({model:this.model,prompt:o,...t});j.debug(`Generated text with model ${this.modelName}, output length: ${a.text.length}`),i=a.text;}return i}catch(i){let a=e?`Failed to generate structured output with model ${this.modelName}`:`Failed to generate text with model ${this.modelName}`;throw j.error(a,{error:i}),new Zr(a,i instanceof Error?i:new Error(String(i)))}}async generateProviderResponse(o,e){try{j.debug(`Generating provider response with model ${this.modelName}, messages count: ${o.length}`);let t=await this._generateText({model:this.model,messages:o,...e});return j.debug(`Generated provider response with model ${this.modelName}`),t}catch(t){let i=`Failed to generate provider response with model ${this.modelName}`;throw j.error(i,{error:t}),new Zr(i,t instanceof Error?t:new Error(String(t)))}}};var lg="gpt-4o";function Yu(n,o){return new Or(n,o)}function mg(n,o){return new Or(n,o)}function QR(n){return n instanceof kr}function YR(n){return typeof n=="object"&&n!==null&&"modelId"in n&&typeof n.modelId=="string"}function XR(n){return typeof n=="string"&&n.length>0}function ZR(n){let o=typeof n,e=o==="object"?JSON.stringify(n):String(n);return new Error(`Invalid model type. Expected one of:
|
|
23
23
|
- string (model ID like 'gpt-4o', 'claude-3-5-sonnet-latest')
|
|
24
24
|
- LanguageModel instance from Vercel AI SDK
|
|
25
25
|
- OpikBaseModel instance
|
|
26
|
-
- undefined (uses default model: ${
|
|
26
|
+
- undefined (uses default model: ${lg})
|
|
27
27
|
|
|
28
|
-
Received: ${o} ${e}`)}function
|
|
29
|
-
`)}function
|
|
30
|
-
`)}function
|
|
28
|
+
Received: ${o} ${e}`)}function Ai(n,o){if(n==null)return Yu(lg,o);if(XR(n))return Yu(n,o);if(QR(n))return n;if(YR(n))return mg(n,o);throw ZR(n)}function dg(n){return n.map(o=>{let e=Array.isArray(o.content)?OR(o.content):o.content;return `${o.role}: ${e}`}).join(`
|
|
29
|
+
`)}function OR(n){return n.map(o=>o.type==="text"?o.text:o.type==="file"?`[file: ${o.filename||"unknown"}]`:o.type==="tool-call"?`[tool-call: ${o.toolName}]`:o.type==="tool-result"?`[tool-result: ${o.toolName}]`:o.type==="reasoning"?`[reasoning: ${o.text}]`:o.type==="tool-approval-request"?"[tool-approval-request]":o.type==="tool-approval-response"?"[tool-approval-response]":"").filter(o=>o.length>0).join(`
|
|
30
|
+
`)}function qR(n,o,e){return typeof n=="string"?le(n,o,e):Array.isArray(n)?n.map(i=>i.type==="text"&&typeof i.text=="string"?{...i,text:le(i.text,o,e)}:i.type==="image"&&typeof i.image=="string"?{...i,image:le(i.image,o,e)}:i.type==="file"&&typeof i.data=="string"?{...i,data:le(i.data,o,e)}:i.type==="reasoning"&&typeof i.text=="string"?{...i,text:le(i.text,o,e)}:i):n}function ug(n,o,e){let t=qR(n.content,o,e);return {...n,content:t}}async function uhe(n){var i;if(!n.dataset)throw new Error("Dataset is required for prompt evaluation");if(!n.messages||n.messages.length===0)throw new Error("Messages array is required and cannot be empty");if(n.experimentConfig!==void 0&&(typeof n.experimentConfig!="object"||n.experimentConfig===null||Array.isArray(n.experimentConfig)))throw new Error("experimentConfig must be a plain object, not an array or primitive value");let o=Ai(n.model),e={...n.experimentConfig,prompt_template:n.messages,model:o.modelName,...n.temperature!==void 0&&{temperature:n.temperature},...n.seed!==void 0&&{seed:n.seed}},t=ew(o,n.messages,(i=n.templateType)!=null?i:Re.MUSTACHE,{temperature:n.temperature,seed:n.seed});return sg({dataset:n.dataset,task:t,scoringMetrics:n.scoringMetrics,experimentName:n.experimentName,projectName:n.projectName,experimentConfig:e,prompts:n.prompts,client:n.client,nbSamples:n.nbSamples,scoringKeyMapping:n.scoringKeyMapping})}function ew(n,o,e,t){return async i=>{let a=o.map(c=>ug(c,i,e)),s=await n.generateProviderResponse(a,t),p=rw(s);return {input:dg(a),output:p}}}function rw(n){return n&&typeof n=="object"?"text"in n&&typeof n.text=="string"?n.text:"content"in n&&typeof n.content=="string"?n.content:JSON.stringify(n):String(n)}var we=class{constructor(o,e=true){if(this.name=o,this.trackMetric=e,e){let t=this.score.bind(this);this.score=Ye({name:this.name,type:Ce.General},t);}}};var tw=zod.z.object({output:zod.z.unknown(),expected:zod.z.unknown()}),fg=class extends we{constructor(e="exact_match",t=true){super(e,t);this.validationSchema=tw;}async score(e){let{output:t,expected:i}=e,a=t===i?1:0;return {name:this.name,value:a,reason:`Exact match: ${a===1?"Match":"No match"}`}}};var ow=zod.z.object({output:zod.z.string(),substring:zod.z.string()}),hg=class extends we{constructor(e="contains",t=true,i=false){super(e,t);this.validationSchema=ow;this.caseSensitive=i;}async score(e){let{output:t,substring:i}=e,a=this.caseSensitive?t:t.toLowerCase(),s=this.caseSensitive?i:i.toLowerCase();return a.includes(s)?{name:this.name,value:1,reason:`Contains: "${i}" found in output.`}:{name:this.name,value:0,reason:`Contains: "${i}" not found in output.`}}};var iw=zod.z.object({output:zod.z.string(),pattern:zod.z.string(),flags:zod.z.string().optional()}),gg=class extends we{constructor(e="regex_match",t=true){super(e,t);this.validationSchema=iw;}async score(e){let{output:t,pattern:i,flags:a}=e,s;typeof i=="string"&&a?s=new RegExp(i,a):s=new RegExp(i);let p=s.test(t);return {name:this.name,value:p?1:0,reason:p?`Regex: Output matches the regex pattern: ${i}`:`Regex: Output does not match the regex pattern: ${i}`}}};var aw=zod.z.object({output:zod.z.unknown()}),bg=class extends we{constructor(e="is_json_metric",t=true){super(e,t);this.validationSchema=aw;}async score(e){let{output:t}=e;try{return JSON.parse(t),{name:this.name,value:1,reason:"IsJson: Output is valid JSON."}}catch{return {name:this.name,value:0,reason:"IsJson: Output is not valid JSON"}}}};var ve=class extends we{constructor(o,e){var i;let t=(i=e==null?void 0:e.trackMetric)!=null?i:true;super(o,t),this.temperature=e==null?void 0:e.temperature,this.seed=e==null?void 0:e.seed,this.maxTokens=e==null?void 0:e.maxTokens,this.modelSettings=e==null?void 0:e.modelSettings,this.model=this.initModel(e==null?void 0:e.model,{trackGenerations:t});}initModel(o,e){return Ai(o,e)}buildModelOptions(){return {...this.modelSettings,...this.temperature!==void 0&&{temperature:this.temperature},...this.seed!==void 0&&{seed:this.seed},...this.maxTokens!==void 0&&{maxTokens:this.maxTokens}}}};function xg(n,o=[]){let e="";return o.length>0&&(e=`
|
|
31
31
|
|
|
32
32
|
###EXAMPLES###
|
|
33
33
|
|
|
@@ -89,7 +89,7 @@ ${e}
|
|
|
89
89
|
Analyze the following text and provide your verdict score, and reason in the specified JSON format:
|
|
90
90
|
|
|
91
91
|
${n}
|
|
92
|
-
`}var
|
|
92
|
+
`}var Ln=class n extends Error{constructor(o){super(o),this.name="MetricError",Error.captureStackTrace&&Error.captureStackTrace(this,n);}},_e=class n extends Ln{constructor(e,t){super(e);this.cause=t;this.name="MetricComputationError",Error.captureStackTrace&&Error.captureStackTrace(this,n);}},Hn=class n extends Ln{constructor(e,t){super(e);this.cause=t;this.name="JSONParsingError",Error.captureStackTrace&&Error.captureStackTrace(this,n);}};function Ze(n){try{return JSON.parse(n)}catch{return nw(n)}}function nw(n){try{let o=n.indexOf("{"),e=n.lastIndexOf("}");if(o===-1||e===-1||o>=e)throw new Error("No valid JSON object found in content");let t=n.substring(o,e+1);return JSON.parse(t)}catch(o){let e=o instanceof Error?o.message:String(o);throw new Hn(`Failed to extract JSON from content: ${e}`,o instanceof Error?o:void 0)}}function Rg(n,o){try{let e=Ze(n),t=Number(e.score);if(isNaN(t)||t<0||t>1)throw new Error(`Moderation score must be between 0.0 and 1.0, got ${t}`);return {name:o,value:t,reason:String(e.reason||"")}}catch(e){let t=e instanceof Error?e.message:String(e);throw j.error(`Failed to parse model output: ${t}`),new _e("Failed to calculate moderation score. The model output could not be parsed.",e instanceof Error?e:void 0)}}var sw=zod.z.object({output:zod.z.string()}),pw=zod.z.object({score:zod.z.number(),reason:zod.z.string()}),Jn=class extends ve{constructor(e){var i,a;let t=(i=e==null?void 0:e.name)!=null?i:"moderation_metric";super(t,{model:e==null?void 0:e.model,trackMetric:e==null?void 0:e.trackMetric,temperature:e==null?void 0:e.temperature,seed:e==null?void 0:e.seed,maxTokens:e==null?void 0:e.maxTokens,modelSettings:e==null?void 0:e.modelSettings});this.validationSchema=sw;this.fewShotExamples=(a=e==null?void 0:e.fewShotExamples)!=null?a:[];}async score(e){let{output:t}=e,i=xg(t,this.fewShotExamples),a=this.buildModelOptions(),s=await this.model.generateString(i,pw,a);return Rg(s,this.name)}};function wg(n,o){return `
|
|
93
93
|
You are an impartial judge tasked with evaluating the quality and usefulness of AI-generated responses.
|
|
94
94
|
Your evaluation should consider the following key factors:
|
|
95
95
|
- Helpfulness: How well does it solve the user's problem?
|
|
@@ -125,7 +125,7 @@ ${n}
|
|
|
125
125
|
AI Response: ${o}
|
|
126
126
|
|
|
127
127
|
Provide your evaluation in the specified JSON format.
|
|
128
|
-
`}function
|
|
128
|
+
`}function _g(n,o){try{let e=Ze(n),t=Number(e.score);if(isNaN(t)||t<0||t>1)throw new Error(`Usefulness score must be between 0.0 and 1.0, got ${t}`);return {name:o,value:t,reason:String(e.reason||"")}}catch(e){let t=e instanceof Error?e.message:String(e);throw j.error(`Failed to parse model output: ${t}`),new _e("Failed to calculate usefulness score. The model output could not be parsed.",e instanceof Error?e:void 0)}}var cw=zod.z.object({input:zod.z.string(),output:zod.z.string()}),lw=zod.z.object({score:zod.z.number(),reason:zod.z.string()}),Gn=class extends ve{constructor(e){var i;let t=(i=e==null?void 0:e.name)!=null?i:"usefulness_metric";super(t,{model:e==null?void 0:e.model,trackMetric:e==null?void 0:e.trackMetric,temperature:e==null?void 0:e.temperature,seed:e==null?void 0:e.seed,maxTokens:e==null?void 0:e.maxTokens,modelSettings:e==null?void 0:e.modelSettings});this.validationSchema=cw;}async score(e){let{input:t,output:i}=e,a=wg(t,i),s=this.buildModelOptions(),p=await this.model.generateString(a,lw,s);return _g(p,this.name)}};var mw=`You are an expert judge tasked with evaluating the faithfulness of an AI-generated answer to the given context. Analyze the provided INPUT, CONTEXT, and OUTPUT to determine if the OUTPUT contains any hallucinations or unfaithful information.
|
|
129
129
|
|
|
130
130
|
Guidelines:
|
|
131
131
|
1. The OUTPUT must not introduce new information beyond what's provided in the CONTEXT.
|
|
@@ -160,7 +160,7 @@ It is crucial that you provide your answer in the following JSON format:
|
|
|
160
160
|
"reason": ["reason 1", "reason 2"]
|
|
161
161
|
}}
|
|
162
162
|
Reasons amount is not restricted. Output must be JSON format only.
|
|
163
|
-
`,
|
|
163
|
+
`,dw=`You are an expert judge tasked with evaluating the factual accuracy and reliability of an AI-generated answer. Analyze the provided INPUT, and OUTPUT to determine if the OUTPUT contains any hallucinations or unfaithful information.
|
|
164
164
|
|
|
165
165
|
Guidelines:
|
|
166
166
|
1. Evaluate the OUTPUT based on generally accepted facts and reliable information.
|
|
@@ -191,7 +191,7 @@ It is crucial that you provide your answer in the following JSON format:
|
|
|
191
191
|
"reason": ["some reason 1", "some reason 2"]
|
|
192
192
|
}}
|
|
193
193
|
Reasons amount is not restricted. Output must be JSON format only.
|
|
194
|
-
`;function
|
|
194
|
+
`;function zg(n,o){return n.length===0?"":`
|
|
195
195
|
|
|
196
196
|
EXAMPLES:
|
|
197
197
|
|
|
@@ -203,7 +203,7 @@ ${i}Output: ${t.output}
|
|
|
203
203
|
{"score": "${t.score}", "reason": "${t.reason}"}
|
|
204
204
|
</example>`}).join(`
|
|
205
205
|
|
|
206
|
-
`)}`}function
|
|
206
|
+
`)}`}function kg(n,o,e,t=[]){let i=zg(t,true);return mw.replace("{examples_str}",i).replace("{input}",n).replace("{context}",JSON.stringify(e)).replace("{output}",o)}function Sg(n,o,e=[]){let t=zg(e,false);return dw.replace("{examples_str}",t).replace("{input}",n).replace("{output}",o)}function Pg(n,o){try{let e=Ze(n),t=e.score;if(t==null)throw new Error(`Hallucination score is required but got ${t}`);let i=Number(t);if(isNaN(i)||i<0||i>1)throw new Error(`Hallucination score must be between 0.0 and 1.0, got ${i}`);let a="",s=e.reason;return Array.isArray(s)?a=s.map(p=>String(p)).join(" "):s&&(a=String(s)),{name:o,value:i,reason:a}}catch(e){let t=e instanceof Error?e.message:String(e);throw j.error(`Failed to parse model output: ${t}`),new _e("Failed to calculate hallucination score. The model output could not be parsed.",e instanceof Error?e:void 0)}}var uw=zod.z.object({input:zod.z.string(),output:zod.z.string(),context:zod.z.array(zod.z.string()).optional()}),fw=zod.z.object({score:zod.z.number(),reason:zod.z.union([zod.z.string(),zod.z.array(zod.z.string())])}),Kn=class extends ve{constructor(e){var i,a;let t=(i=e==null?void 0:e.name)!=null?i:"hallucination_metric";super(t,{model:e==null?void 0:e.model,trackMetric:e==null?void 0:e.trackMetric,temperature:e==null?void 0:e.temperature,seed:e==null?void 0:e.seed,maxTokens:e==null?void 0:e.maxTokens,modelSettings:e==null?void 0:e.modelSettings});this.validationSchema=uw;this.fewShotExamples=(a=e==null?void 0:e.fewShotExamples)!=null?a:[];}async score(e){let{input:t,output:i,context:a}=e,s=a?kg(t,i,a,this.fewShotExamples):Sg(t,i,this.fewShotExamples),p=this.buildModelOptions(),l=await this.model.generateString(s,fw,p);return Pg(l,this.name)}};var Ag=[{title:"Low Relevance Score",input:"What's the capital of France?",output:"The Eiffel Tower is a famous landmark.",context:["France is a country in Europe.","Paris is known for its iconic Eiffel Tower."],answer_relevance_score:.2,reason:"The answer provides information about the Eiffel Tower, which is related to France, but fails to address the specific question about the capital city. It doesn't directly answer the user's query, resulting in low relevance."},{title:"Medium Relevance Score",input:"What's the capital of France?",output:"France has many beautiful cities, including Paris.",context:["France is a country in Europe.","Paris is the capital and largest city of France."],answer_relevance_score:.6,reason:"The answer mentions Paris, which is the correct capital, but it's presented as just one of many cities rather than explicitly stating it's the capital. The response is partially relevant but lacks directness in addressing the specific question."},{title:"High Relevance Score",input:"What's the capital of France?",output:"The capital of France is Paris, a city known for its iconic Eiffel Tower.",context:["France is a country in Europe.","Paris is the capital and largest city of France."],answer_relevance_score:.9,reason:"The answer directly and correctly identifies Paris as the capital of France, which is highly relevant to the user's question. It also provides additional context about the Eiffel Tower, which aligns with the provided context. The response is comprehensive and relevant, though slightly more detailed than necessary, preventing a perfect score."}],Tg=[{title:"Low Relevance Score",input:"What's the capital of France?",output:"The Eiffel Tower is a famous landmark.",answer_relevance_score:.2,reason:"The answer provides information about the Eiffel Tower, which is related to France, but fails to address the specific question about the capital city. It doesn't directly answer the user's query, resulting in low relevance."},{title:"Medium Relevance Score",input:"What's the capital of France?",output:"France has many beautiful cities, including Paris.",answer_relevance_score:.6,reason:"The answer mentions Paris, which is the correct capital, but it's presented as just one of many cities rather than explicitly stating it's the capital. The response is partially relevant but lacks directness in addressing the specific question."},{title:"High Relevance Score",input:"What's the capital of France?",output:"The capital of France is Paris, a city known for its iconic Eiffel Tower.",answer_relevance_score:.9,reason:"The answer directly and correctly identifies Paris as the capital of France, which is highly relevant to the user's question. It also provides additional context about the Eiffel Tower, which aligns with the provided context. The response is comprehensive and relevant, though slightly more detailed than necessary, preventing a perfect score."}];function hw(n){return n.map((o,e)=>`#### Example ${e+1}: ${o.title}
|
|
207
207
|
|
|
208
208
|
- **Input:** "${o.input}"
|
|
209
209
|
- **Output:** "${o.output}"
|
|
@@ -216,7 +216,7 @@ ${i}Output: ${t.output}
|
|
|
216
216
|
}
|
|
217
217
|
\`\`\``).join(`
|
|
218
218
|
|
|
219
|
-
`)}function
|
|
219
|
+
`)}function gw(n){return n.map((o,e)=>`#### Example ${e+1}: ${o.title}
|
|
220
220
|
|
|
221
221
|
- **Input:** "${o.input}"
|
|
222
222
|
- **Output:** "${o.output}"
|
|
@@ -228,7 +228,7 @@ ${i}Output: ${t.output}
|
|
|
228
228
|
}
|
|
229
229
|
\`\`\``).join(`
|
|
230
230
|
|
|
231
|
-
`)}function
|
|
231
|
+
`)}function vg(n,o,e,t){return `
|
|
232
232
|
YOU ARE AN EXPERT IN NLP EVALUATION METRICS, SPECIALLY TRAINED TO ASSESS ANSWER RELEVANCE IN RESPONSES
|
|
233
233
|
PROVIDED BY LANGUAGE MODELS. YOUR TASK IS TO EVALUATE THE RELEVANCE OF A GIVEN ANSWER FROM
|
|
234
234
|
ANOTHER LLM BASED ON THE USER'S INPUT AND CONTEXT PROVIDED.
|
|
@@ -274,7 +274,7 @@ ${i}Output: ${t.output}
|
|
|
274
274
|
|
|
275
275
|
###FEW-SHOT EXAMPLES###
|
|
276
276
|
|
|
277
|
-
${
|
|
277
|
+
${hw(t)}
|
|
278
278
|
|
|
279
279
|
###INPUTS:###
|
|
280
280
|
***
|
|
@@ -287,7 +287,7 @@ ${i}Output: ${t.output}
|
|
|
287
287
|
Context:
|
|
288
288
|
${JSON.stringify(e)}
|
|
289
289
|
***
|
|
290
|
-
`}function
|
|
290
|
+
`}function jg(n,o,e){return `
|
|
291
291
|
YOU ARE AN EXPERT IN NLP EVALUATION METRICS, SPECIALLY TRAINED TO ASSESS ANSWER RELEVANCE IN RESPONSES
|
|
292
292
|
PROVIDED BY LANGUAGE MODELS. YOUR TASK IS TO EVALUATE THE RELEVANCE OF A GIVEN ANSWER FROM
|
|
293
293
|
ANOTHER LLM BASED ON THE USER'S INPUT.
|
|
@@ -332,7 +332,7 @@ ${i}Output: ${t.output}
|
|
|
332
332
|
|
|
333
333
|
###FEW-SHOT EXAMPLES###
|
|
334
334
|
|
|
335
|
-
${
|
|
335
|
+
${gw(e)}
|
|
336
336
|
|
|
337
337
|
###INPUTS:###
|
|
338
338
|
***
|
|
@@ -342,4 +342,4 @@ ${i}Output: ${t.output}
|
|
|
342
342
|
Output:
|
|
343
343
|
${o}
|
|
344
344
|
***
|
|
345
|
-
`}function
|
|
345
|
+
`}function Eg(n,o){try{let e=Ze(n),t=e.answer_relevance_score;if(t==null)throw new Error(`Answer relevance score is required but got ${t}`);let i=Number(t);if(isNaN(i)||i<0||i>1)throw new Error(`Answer relevance score must be between 0.0 and 1.0, got ${i}`);return {name:o,value:i,reason:String(e.reason||"")}}catch(e){let t=e instanceof Error?e.message:String(e);throw j.error(`Failed to parse model output: ${t}`),new _e("Failed to calculate answer relevance score. The model output could not be parsed.",e instanceof Error?e:void 0)}}var yw=zod.z.object({input:zod.z.string(),output:zod.z.string(),context:zod.z.array(zod.z.string()).optional()}),bw=zod.z.object({answer_relevance_score:zod.z.number(),reason:zod.z.string()}),$n=class extends ve{constructor(e){var i,a,s,p;let t=(i=e==null?void 0:e.name)!=null?i:"answer_relevance_metric";super(t,{model:e==null?void 0:e.model,trackMetric:e==null?void 0:e.trackMetric,temperature:e==null?void 0:e.temperature,seed:e==null?void 0:e.seed,maxTokens:e==null?void 0:e.maxTokens,modelSettings:e==null?void 0:e.modelSettings});this.validationSchema=yw;this.fewShotExamplesWithContext=(a=e==null?void 0:e.fewShotExamples)!=null?a:Ag,this.fewShotExamplesNoContext=(s=e==null?void 0:e.fewShotExamplesNoContext)!=null?s:Tg,this.requireContext=(p=e==null?void 0:e.requireContext)!=null?p:true;}async score(e){let{input:t,output:i,context:a}=e;if(!a&&this.requireContext)throw new _e(`${this.name} requires context by default. If you want to allow execution in no-context mode, enable it via 'new AnswerRelevance({ requireContext: false })'`);let s=a?vg(t,i,a,this.fewShotExamplesWithContext):jg(t,i,this.fewShotExamplesNoContext),p=this.buildModelOptions(),l=await this.model.generateString(s,bw,p);return Eg(l,this.name)}};Object.defineProperty(exports,"z",{enumerable:true,get:function(){return zod.z}});exports.AnswerRelevance=$n;exports.BaseLLMJudgeMetric=ve;exports.BaseMetric=we;exports.Contains=hg;exports.ExactMatch=fg;exports.Hallucination=Kn;exports.IsJson=bg;exports.ModelConfigurationError=Xe;exports.ModelError=Pi;exports.ModelGenerationError=Zr;exports.Moderation=Jn;exports.Opik=zr;exports.OpikBaseModel=kr;exports.OpikQueryLanguage=Qe;exports.OpikSpanType=Ce;exports.Prompt=Ke;exports.PromptType=Re;exports.RegexMatch=gg;exports.Usefulness=Gn;exports.VercelAIChatModel=Or;exports.createModel=Yu;exports.createModelFromInstance=mg;exports.detectProvider=Qu;exports.disableLogger=Vg;exports.evaluate=sg;exports.evaluatePrompt=uhe;exports.flushAll=vR;exports.generateId=ae;exports.getTrackContext=SR;exports.logger=j;exports.resolveModel=Ai;exports.setLoggerLevel=pf;exports.track=Ye;
|