opik 1.10.6 → 1.10.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';var ansiEscapes=require('ansi-escapes'),tslog=require('tslog'),Sf=require('fs'),Af=require('os'),sy=require('path'),py=require('ini');require('dotenv/config');var uuid=require('uuid'),vx=require('fast-json-stable-stringify'),Tx=require('xxhash-wasm'),util=require('util'),Dx=require('mustache'),Nx=require('nunjucks'),dateFns=require('date-fns'),jestDiff=require('jest-diff'),Bx=require('fast-deep-equal'),async_hooks=require('async_hooks'),$n=require('chalk'),Zx=require('boxen'),Ox=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 Sf__default=/*#__PURE__*/_interopDefault(Sf);var Af__default=/*#__PURE__*/_interopDefault(Af);var sy__default=/*#__PURE__*/_interopDefault(sy);var py__default=/*#__PURE__*/_interopDefault(py);var vx__default=/*#__PURE__*/_interopDefault(vx);var Tx__default=/*#__PURE__*/_interopDefault(Tx);var Dx__default=/*#__PURE__*/_interopDefault(Dx);var Nx__default=/*#__PURE__*/_interopDefault(Nx);var Bx__default=/*#__PURE__*/_interopDefault(Bx);var $n__default=/*#__PURE__*/_interopDefault($n);var Zx__default=/*#__PURE__*/_interopDefault(Zx);var Ox__default=/*#__PURE__*/_interopDefault(Ox);var Zg=Object.create;var Ui=Object.defineProperty;var Og=Object.getOwnPropertyDescriptor;var xf=(s,o)=>(o=Symbol[s])?o:Symbol.for("Symbol."+s),at=s=>{throw TypeError(s)};var qg=(s,o,e)=>o in s?Ui(s,o,{enumerable:true,configurable:true,writable:true,value:e}):s[o]=e;var W=(s,o)=>{for(var e in o)Ui(s,e,{get:o[e],enumerable:true});};var wf=s=>{var o;return [,,,Zg((o=void 0)!=null?o:null)]},_f=["class","method","getter","setter","accessor","field","value","get","set"],it=s=>s!==void 0&&typeof s!="function"?at("Function expected"):s,ey=(s,o,e,t,i)=>({kind:_f[s],name:o,metadata:t,addInitializer:a=>e._?at("Already initialized"):i.push(it(a||null))}),os=(s,o)=>qg(o,xf("metadata"),s[3]),zf=(s,o,e,t)=>{for(var i=0,a=s[o>>1],n=a&&a.length;i<n;i++)a[i].call(e);return t},kf=(s,o,e,t,i,a)=>{var p,l,c,d,m=o&7,f=false,u=false,h=2,g=_f[m+5],T=s[h]||(s[h]=[]),v=((i=i.prototype),Og(i,e));for(var E=t.length-1;E>=0;E--)c=ey(m,e,l={},s[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,it(p)&&(v[g]=p);return v&&Ui(i,e,v),i};var ay={SILLY:0,TRACE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,FATAL:6};function Fi(s,o=s){return ansiEscapes.link(o,s)}var j=new tslog.Logger({hideLogPositionForProduction:true,prettyLogTemplate:"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}} {{logLevelName}} "}),Pf=s=>{j.settings.minLevel=ay[s];},ny=()=>{j.settings.minLevel=100;};Pf(process.env.OPIK_LOG_LEVEL||"INFO");var cy=sy__default.default.join(Af__default.default.homedir(),".opik.config"),as={apiKey:"",apiUrl:"https://www.comet.com/opik/api",projectName:"Default Project",workspaceName:"default",batchDelayMs:300,holdUntilFlush:false};function Tf(s){return Object.fromEntries(Object.entries(s).filter(([,o])=>o!==void 0))}function ly(){return Tf({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 my(s){return s.replace(/^~(?=$|\/|\\)/,Af__default.default.homedir())}function dy(){let s=process.env.OPIK_CONFIG_PATH||cy,o=my(s);if(!Sf__default.default.existsSync(o)){if(process.env.OPIK_CONFIG_PATH)throw new Error(`Config file not found at ${o}`);return {}}try{let e=py__default.default.parse(Sf__default.default.readFileSync(o,"utf8"));return e.opik?Tf({apiKey:e.opik.api_key,apiUrl:e.opik.url_override,projectName:e.opik.project_name,workspaceName:e.opik.workspace}):{}}catch(e){return j.error(`Error loading config file ${o}: ${e}`),{}}}function vf(s){let o=ly(),e=dy(),{headers:t,...i}=s||{};return uy({...as,...e,...o,...i})}function uy(s){if(!s.apiUrl)throw new Error("OPIK_URL_OVERRIDE is not set");let o=fy(s.apiUrl);if(o&&!s.apiKey)throw new Error("OPIK_API_KEY is not set");if(o&&!s.workspaceName)throw new Error("OPIK_WORKSPACE is not set");return s}function fy(s){return new URL(s).hostname.endsWith("comet.com")}var q={};W(q,{AlertAlertType:()=>gy,AlertPublicAlertType:()=>yy,AlertTriggerConfigPublicType:()=>by,AlertTriggerConfigType:()=>Ry,AlertTriggerConfigWriteType:()=>xy,AlertTriggerEventType:()=>wy,AlertTriggerPublicEventType:()=>_y,AlertTriggerWriteEventType:()=>zy,AlertWriteAlertType:()=>ky,AnnotationQueuePublicScope:()=>Py,AnnotationQueueScope:()=>Sy,AnnotationQueueWriteScope:()=>Ay,AssistantMessageRole:()=>Ty,AttachmentListRequestEntityType:()=>Ef,AutomationRuleEvaluatorAction:()=>vy,AutomationRuleEvaluatorObjectObjectPublicAction:()=>jy,AutomationRuleEvaluatorPublicAction:()=>Ey,AutomationRuleEvaluatorUpdateAction:()=>Cy,AutomationRuleEvaluatorWriteAction:()=>Iy,BadGatewayError:()=>st,BadRequestError:()=>D,BreakdownConfigPublicField:()=>Dy,CheckName:()=>Uy,CheckPublicName:()=>Fy,CheckPublicResult:()=>Ny,CheckResult:()=>My,ColumnCompareTypesItem:()=>Wy,ColumnPublicTypesItem:()=>By,ColumnTypesItem:()=>Vy,CompleteMultipartUploadRequestEntityType:()=>Ly,ConflictError:()=>$,CreatePromptVersionDetailTemplateStructure:()=>Kf,DatasetExportJobPublicStatus:()=>Hy,DatasetItemCompareSource:()=>Jy,DatasetItemFilterOperator:()=>Gy,DatasetItemPublicSource:()=>Ky,DatasetItemSource:()=>$y,DatasetItemWriteSource:()=>ws,DatasetPublicStatus:()=>Qy,DatasetPublicVisibility:()=>Yy,DatasetStatus:()=>Xy,DatasetUpdateVisibility:()=>Uf,DatasetVisibility:()=>Zy,DatasetWriteVisibility:()=>Ff,DeleteAttachmentsRequestEntityType:()=>Oy,DownloadAttachmentRequestEntityType:()=>Cf,ExperimentItemCompareTraceVisibilityMode:()=>qy,ExperimentItemPublicTraceVisibilityMode:()=>eb,ExperimentItemTraceVisibilityMode:()=>rb,ExperimentPublicStatus:()=>tb,ExperimentPublicType:()=>ob,ExperimentStatus:()=>ib,ExperimentType:()=>_s,ExperimentUpdateStatus:()=>ab,ExperimentUpdateType:()=>nb,ExperimentWriteStatus:()=>Nf,ExperimentWriteType:()=>Mf,FeedbackScoreBatchItemSource:()=>zs,FeedbackScoreBatchItemThreadSource:()=>sb,FeedbackScoreCompareSource:()=>pb,FeedbackScoreExperimentItemBulkWriteViewSource:()=>cb,FeedbackScorePublicSource:()=>lb,FeedbackScoreSource:()=>mb,FindFeedbackDefinitionsRequestType:()=>Wf,FindFeedbackScoreNames1RequestType:()=>Yf,ForbiddenError:()=>se,GetSpanStatsRequestType:()=>Xf,GetSpansByProjectRequestType:()=>Zf,GetWebhookExamplesRequestAlertType:()=>jf,GuardrailName:()=>db,GuardrailResult:()=>ub,GuardrailWriteName:()=>fb,GuardrailWriteResult:()=>hb,InternalServerError:()=>pt,LlmAsJudgeMessagePublicRole:()=>gb,LlmAsJudgeMessageRole:()=>yb,LlmAsJudgeMessageWriteRole:()=>bb,LlmAsJudgeOutputSchemaPublicType:()=>Rb,LlmAsJudgeOutputSchemaType:()=>xb,LlmAsJudgeOutputSchemaWriteType:()=>wb,LogItemLevel:()=>_b,ManualEvaluationRequestEntityType:()=>zb,NotFoundError:()=>I,NotImplementedError:()=>er,OptimizationPublicStatus:()=>kb,OptimizationStatus:()=>Pb,OptimizationUpdateStatus:()=>Vf,OptimizationWriteStatus:()=>Sb,ProjectDetailedVisibility:()=>Ab,ProjectMetricRequestPublicInterval:()=>Lf,ProjectMetricRequestPublicMetricType:()=>Hf,ProjectMetricResponsePublicInterval:()=>Tb,ProjectMetricResponsePublicMetricType:()=>vb,ProjectPublicVisibility:()=>jb,ProjectUpdateVisibility:()=>Jf,ProjectVisibility:()=>Eb,ProjectWriteVisibility:()=>Gf,PromptDetailTemplateStructure:()=>Cb,PromptPublicTemplateStructure:()=>Ib,PromptTemplateStructure:()=>Db,PromptType:()=>Ub,PromptVersionDetailTemplateStructure:()=>Fb,PromptVersionDetailType:()=>Nb,PromptVersionPublicTemplateStructure:()=>Mb,PromptVersionPublicType:()=>Wb,PromptVersionTemplateStructure:()=>Bb,PromptVersionType:()=>Vb,PromptWriteTemplateStructure:()=>$f,PromptWriteType:()=>Qf,ProviderApiKeyProvider:()=>Lb,ProviderApiKeyPublicProvider:()=>Hb,ProviderApiKeyWriteProvider:()=>Bf,ResponseFormatType:()=>Jb,ServiceUnavailableError:()=>Sr,SpanExperimentItemBulkWriteViewType:()=>Gb,SpanFilterOperator:()=>Kb,SpanFilterPublicOperator:()=>$b,SpanFilterWriteOperator:()=>Qb,SpanPublicType:()=>Yb,SpanSearchStreamRequestPublicType:()=>Of,SpanType:()=>Ce,SpanUpdateType:()=>Xb,SpanWriteType:()=>Zb,StartMultipartUploadRequestEntityType:()=>If,ToolCallType:()=>Ob,ToolType:()=>qb,TraceFilterOperator:()=>eR,TraceFilterPublicOperator:()=>rR,TraceFilterWriteOperator:()=>tR,TracePublicVisibilityMode:()=>oR,TraceThreadFilterOperator:()=>iR,TraceThreadFilterPublicOperator:()=>aR,TraceThreadFilterWriteOperator:()=>nR,TraceThreadStatus:()=>sR,TraceVisibilityMode:()=>pR,UnauthorizedError:()=>re,UnprocessableEntityError:()=>Q,UploadAttachmentRequestEntityType:()=>Df,ValueEntryCompareSource:()=>cR,ValueEntryExperimentItemBulkWriteViewSource:()=>lR,ValueEntryPublicSource:()=>mR,ValueEntrySource:()=>dR,WebhookTestResultStatus:()=>uR,alerts:()=>Ni,annotationQueues:()=>ns,attachments:()=>Mi,automationRuleEvaluators:()=>ss,chatCompletions:()=>ps,check:()=>cs,dashboards:()=>ls,datasets:()=>Wi,experiments:()=>Bi,feedbackDefinitions:()=>Vi,guardrails:()=>ms,llmProviderKey:()=>Li,manualEvaluation:()=>ds,ollama:()=>us,openTelemetryIngestion:()=>fs,optimizations:()=>Hi,projects:()=>Ji,prompts:()=>Gi,redirect:()=>hs,serviceToggles:()=>gs,spans:()=>Ki,systemUsage:()=>ys,traces:()=>bs,welcomeWizard:()=>Rs,workspaces:()=>xs});var Pe=(s,o,e)=>JSON.stringify(s,o,e);function nt(s,o){return JSON.parse(s,o)}var w=class extends Error{constructor({message:o,statusCode:e,body:t,rawResponse:i}){super(hy({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 hy({message:s,statusCode:o,body:e}){let t=[];return s!=null&&t.push(s),o!=null&&t.push(`Status code: ${o.toString()}`),e!=null&&t.push(`Body: ${Pe(e,void 0,2)}`),t.join(`
2
2
  `)}var Pr=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 st=class extends w{constructor(o,e){super({message:"BadGatewayError",statusCode:502,body:o,rawResponse:e}),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 se=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 pt=class extends w{constructor(o,e){super({message:"InternalServerError",statusCode:500,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 er=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 Sr=class extends w{constructor(o,e){super({message:"ServiceUnavailableError",statusCode:503,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 Q=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 Ni={};W(Ni,{GetWebhookExamplesRequestAlertType:()=>jf});var jf={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var ns={};var Mi={};W(Mi,{AttachmentListRequestEntityType:()=>Ef,DownloadAttachmentRequestEntityType:()=>Cf,StartMultipartUploadRequestEntityType:()=>If,UploadAttachmentRequestEntityType:()=>Df});var Ef={Trace:"trace",Span:"span"};var Cf={Trace:"trace",Span:"span"};var If={Trace:"trace",Span:"span"};var Df={Trace:"trace",Span:"span"};var ss={};var ps={};var cs={};var ls={};var Wi={};W(Wi,{DatasetUpdateVisibility:()=>Uf,DatasetWriteVisibility:()=>Ff});var Uf={Private:"private",Public:"public"};var Ff={Private:"private",Public:"public"};var Bi={};W(Bi,{ExperimentWriteStatus:()=>Nf,ExperimentWriteType:()=>Mf});var Nf={Running:"running",Completed:"completed",Cancelled:"cancelled"};var Mf={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var Vi={};W(Vi,{FindFeedbackDefinitionsRequestType:()=>Wf});var Wf={Numerical:"numerical",Categorical:"categorical",Boolean:"boolean"};var ms={};var Li={};W(Li,{ProviderApiKeyWriteProvider:()=>Bf});var Bf={Openai:"openai",Anthropic:"anthropic",Gemini:"gemini",Openrouter:"openrouter",VertexAi:"vertex-ai",Bedrock:"bedrock",Ollama:"ollama",CustomLlm:"custom-llm",OpikFree:"opik-free"};var ds={};var us={};var fs={};var Hi={};W(Hi,{OptimizationUpdateStatus:()=>Vf});var Vf={Running:"running",Completed:"completed",Cancelled:"cancelled",Initialized:"initialized",Error:"error"};var Ji={};W(Ji,{ProjectMetricRequestPublicInterval:()=>Lf,ProjectMetricRequestPublicMetricType:()=>Hf,ProjectUpdateVisibility:()=>Jf,ProjectWriteVisibility:()=>Gf});var Lf={Hourly:"HOURLY",Daily:"DAILY",Weekly:"WEEKLY"};var Hf={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 Jf={Private:"private",Public:"public"};var Gf={Private:"private",Public:"public"};var Gi={};W(Gi,{CreatePromptVersionDetailTemplateStructure:()=>Kf,PromptWriteTemplateStructure:()=>$f,PromptWriteType:()=>Qf});var Kf={Text:"text",Chat:"chat"};var $f={Text:"text",Chat:"chat"};var Qf={Mustache:"mustache",Jinja2:"jinja2"};var hs={};var gs={};var Ki={};W(Ki,{FindFeedbackScoreNames1RequestType:()=>Yf,GetSpanStatsRequestType:()=>Xf,GetSpansByProjectRequestType:()=>Zf,SpanSearchStreamRequestPublicType:()=>Of});var Yf={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Xf={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Zf={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Of={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var ys={};var bs={};var Rs={};var xs={};var gy={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var yy={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var by={ScopeProject:"scope:project",ThresholdFeedbackScore:"threshold:feedback_score",ThresholdCost:"threshold:cost",ThresholdLatency:"threshold:latency",ThresholdErrors:"threshold:errors"};var Ry={ScopeProject:"scope:project",ThresholdFeedbackScore:"threshold:feedback_score",ThresholdCost:"threshold:cost",ThresholdLatency:"threshold:latency",ThresholdErrors:"threshold:errors"};var xy={ScopeProject:"scope:project",ThresholdFeedbackScore:"threshold:feedback_score",ThresholdCost:"threshold:cost",ThresholdLatency:"threshold:latency",ThresholdErrors:"threshold:errors"};var wy={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 _y={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 zy={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 ky={General:"general",Slack:"slack",Pagerduty:"pagerduty"};var Py={Trace:"trace",Thread:"thread"};var Sy={Trace:"trace",Thread:"thread"};var Ay={Trace:"trace",Thread:"thread"};var Ty={System:"system",User:"user",Assistant:"assistant",Tool:"tool",Function:"function"};var vy={Evaluator:"evaluator"};var jy={Evaluator:"evaluator"};var Ey={Evaluator:"evaluator"};var Cy={Evaluator:"evaluator"};var Iy={Evaluator:"evaluator"};var Dy={None:"none",Tags:"tags",Metadata:"metadata",Name:"name",ErrorInfo:"error_info",Model:"model",Provider:"provider",Type:"type"};var Uy={Topic:"TOPIC",Pii:"PII"};var Fy={Topic:"TOPIC",Pii:"PII"};var Ny={Passed:"passed",Failed:"failed"};var My={Passed:"passed",Failed:"failed"};var Wy={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 Vy={String:"string",Number:"number",Object:"object",Boolean:"boolean",Array:"array",Null:"null"};var Ly={Trace:"trace",Span:"span"};var Hy={Pending:"PENDING",Processing:"PROCESSING",Completed:"COMPLETED",Failed:"FAILED"};var Jy={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var Gy={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 $y={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var ws={Manual:"manual",Trace:"trace",Span:"span",Sdk:"sdk"};var Qy={Unknown:"unknown",Processing:"processing",Completed:"completed",Failed:"failed"};var Yy={Private:"private",Public:"public"};var Xy={Unknown:"unknown",Processing:"processing",Completed:"completed",Failed:"failed"};var Zy={Private:"private",Public:"public"};var Oy={Trace:"trace",Span:"span"};var qy={Default:"default",Hidden:"hidden"};var eb={Default:"default",Hidden:"hidden"};var rb={Default:"default",Hidden:"hidden"};var tb={Running:"running",Completed:"completed",Cancelled:"cancelled"};var ob={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var ib={Running:"running",Completed:"completed",Cancelled:"cancelled"};var _s={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var ab={Running:"running",Completed:"completed",Cancelled:"cancelled"};var nb={Regular:"regular",Trial:"trial",MiniBatch:"mini-batch"};var zs={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var sb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var pb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var cb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var lb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var mb={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var db={Topic:"TOPIC",Pii:"PII"};var ub={Passed:"passed",Failed:"failed"};var fb={Topic:"TOPIC",Pii:"PII"};var hb={Passed:"passed",Failed:"failed"};var gb={System:"SYSTEM",User:"USER",Ai:"AI",ToolExecutionResult:"TOOL_EXECUTION_RESULT",Custom:"CUSTOM"};var yb={System:"SYSTEM",User:"USER",Ai:"AI",ToolExecutionResult:"TOOL_EXECUTION_RESULT",Custom:"CUSTOM"};var bb={System:"SYSTEM",User:"USER",Ai:"AI",ToolExecutionResult:"TOOL_EXECUTION_RESULT",Custom:"CUSTOM"};var Rb={Boolean:"BOOLEAN",Integer:"INTEGER",Double:"DOUBLE"};var xb={Boolean:"BOOLEAN",Integer:"INTEGER",Double:"DOUBLE"};var wb={Boolean:"BOOLEAN",Integer:"INTEGER",Double:"DOUBLE"};var _b={Info:"INFO",Warn:"WARN",Error:"ERROR",Debug:"DEBUG",Trace:"TRACE"};var zb={Trace:"trace",Thread:"thread",Span:"span"};var kb={Running:"running",Completed:"completed",Cancelled:"cancelled",Initialized:"initialized",Error:"error"};var Pb={Running:"running",Completed:"completed",Cancelled:"cancelled",Initialized:"initialized",Error:"error"};var Sb={Running:"running",Completed:"completed",Cancelled:"cancelled",Initialized:"initialized",Error:"error"};var Ab={Private:"private",Public:"public"};var Tb={Hourly:"HOURLY",Daily:"DAILY",Weekly:"WEEKLY"};var vb={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 jb={Private:"private",Public:"public"};var Eb={Private:"private",Public:"public"};var Cb={Text:"text",Chat:"chat"};var Ib={Text:"text",Chat:"chat"};var Db={Text:"text",Chat:"chat"};var Ub={Mustache:"mustache",Jinja2:"jinja2"};var Fb={Text:"text",Chat:"chat"};var Nb={Mustache:"mustache",Jinja2:"jinja2"};var Mb={Text:"text",Chat:"chat"};var Wb={Mustache:"mustache",Jinja2:"jinja2"};var Bb={Text:"text",Chat:"chat"};var Vb={Mustache:"mustache",Jinja2:"jinja2"};var Lb={Openai:"openai",Anthropic:"anthropic",Gemini:"gemini",Openrouter:"openrouter",VertexAi:"vertex-ai",Bedrock:"bedrock",Ollama:"ollama",CustomLlm:"custom-llm",OpikFree:"opik-free"};var Hb={Openai:"openai",Anthropic:"anthropic",Gemini:"gemini",Openrouter:"openrouter",VertexAi:"vertex-ai",Bedrock:"bedrock",Ollama:"ollama",CustomLlm:"custom-llm",OpikFree:"opik-free"};var Jb={Text:"text",JsonObject:"json_object",JsonSchema:"json_schema"};var Gb={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 $b={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 Qb={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 Yb={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Ce={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Xb={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Zb={General:"general",Tool:"tool",Llm:"llm",Guardrail:"guardrail"};var Ob={Function:"function"};var qb={Function:"function"};var eR={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 rR={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 tR={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 oR={Default:"default",Hidden:"hidden"};var iR={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 aR={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 nR={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 sR={Active:"active",Inactive:"inactive"};var pR={Default:"default",Hidden:"hidden"};var cR={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var lR={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var mR={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var dR={Ui:"ui",Sdk:"sdk",OnlineScoring:"online_scoring"};var uR={Success:"success",Failure:"failure"};function z(...s){let o={};for(let[e,t]of s.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 S(...s){let o={};for(let[e,t]of s.filter(i=>i!=null).flatMap(i=>Object.entries(i))){let i=e.toLowerCase();t!=null&&(o[i]=t);}return o}var ks={get:async(s,o)=>typeof s=="function"?s(o):s};var fe={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},qf={[fe.Debug]:1,[fe.Info]:2,[fe.Warn]:3,[fe.Error]:4},rr=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);}},Ar=class{constructor(o){this.level=qf[o.level],this.logger=o.logger,this.silent=o.silent;}shouldLog(o){return !this.silent&&this.level<=qf[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 Ps(s){return s==null?fR:s instanceof Ar?s:(s=s!=null?s:{},(s.level)!=null||(s.level=fe.Info),(s.logger)!=null||(s.logger=new rr),(s.silent)!=null||(s.silent=true),new Ar(s))}var fR=new Ar({level:fe.Info,logger:new rr,silent:true});var gR={arrayFormat:"indices",encode:true};function eh(s,o){if(s===void 0||s===null)return "";let e=String(s);return o?encodeURIComponent(e):e}function Ss(s,o="",e){let t=[];for(let[i,a]of Object.entries(s)){let n=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"?`${n}[${p}]`:n;t.push(...Ss(l,c,e));}else {let c=e.arrayFormat==="indices"?`${n}[${p}]`:n,d=e.encode?encodeURIComponent(c):c;t.push(`${d}=${eh(l,e.encode)}`);}}}else if(typeof a=="object"&&a!==null){if(Object.keys(a).length===0)continue;t.push(...Ss(a,n,e));}else {let p=e.encode?encodeURIComponent(n):n;t.push(`${p}=${eh(a,e.encode)}`);}}return t}function tr(s,o){return s==null||typeof s!="object"?"":Ss(s,"",{...gR,...o}).join("&")}function rh(s,o){let e=tr(o,{arrayFormat:"repeat"});return e?`${s}?${e}`:s}function th(s){let o={get bodyUsed(){return s.bodyUsed},stream:()=>s.body,arrayBuffer:s.arrayBuffer.bind(s),blob:s.blob.bind(s)};return "bytes"in s&&typeof s.bytes=="function"&&(o.bytes=s.bytes.bind(s)),o}async function $i(s,o){switch(o){case "binary-response":return th(s);case "blob":return await s.blob();case "arrayBuffer":return await s.arrayBuffer();case "sse":return s.body==null?{ok:false,error:{reason:"body-is-null",statusCode:s.status}}:s.body;case "streaming":return s.body==null?{ok:false,error:{reason:"body-is-null",statusCode:s.status}}:s.body;case "text":return await s.text()}let e=await s.text();if(e.length>0)try{return nt(e)}catch{return {ok:false,error:{reason:"non-json",statusCode:s.status,rawBody:e}}}}async function oh(s){var e,t,i;let o=(e=s.headers.get("Content-Type"))==null?void 0:e.toLowerCase();if(o==null||o.length===0)return $i(s);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 s.text();return a.length>0?nt(a):void 0}default:if(o.startsWith("application/vnd.")&&o.endsWith("+json")){let a=await s.text();return a.length>0?nt(a):void 0}return await s.text()}}async function ih(){return fetch}async function ah({body:s,type:o}){return o==="form"?tr(s,{arrayFormat:"repeat",encode:true}):o.includes("json")?Pe(s):s}var Le;typeof globalThis.Headers!="undefined"?Le=globalThis.Headers:Le=class nh{constructor(o){if(this.headers=new Map,o)if(o instanceof nh)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 yR="timeout";function sh(s){let o=new AbortController,e=setTimeout(()=>o.abort(yR),s);return {signal:o.signal,abortId:e}}function ph(...s){let o=s.length===1&&Array.isArray(s[0])?s[0]:s,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 ch=async(s,o,e,t,i,a,n,p,l)=>{let c=[],d;if(a!=null){let{signal:u,abortId:h}=sh(a);d=h,c.push(u);}n!=null&&c.push(n);let m=ph(c),f=await s(o,{method:e,headers:t,body:i,signal:m,credentials:p?"include":void 0,duplex:l});return d!=null&&clearTimeout(d),f};var Qi={headers:new Le,redirected:false,status:499,statusText:"Client Closed Request",type:"error",url:""},Yi={headers:new Le,redirected:false,status:0,statusText:"Unknown Error",type:"error",url:""};function Xi(s){return {headers:s.headers,redirected:s.redirected,status:s.status,statusText:s.statusText,type:s.type,url:s.url}}function bR(s){let o=1+Math.random()*.2;return s*o}function RR(s){let o=1+(Math.random()-.5)*.2;return s*o}function xR(s,o){let e=s.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 n=a.getTime()-Date.now();if(n>0)return Math.min(Math.max(n,0),6e4)}}let t=s.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 bR(Math.min(a,6e4))}}return RR(Math.min(1e3*2**o,6e4))}async function lh(s,o=2){let e=await s();for(let t=0;t<o&&([408,429].includes(e.status)||e.status>=500);++t){let i=xR(e,t);await new Promise(a=>setTimeout(a,i)),e=await s();}return e}var wR=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 As(s){let o={};for(let[e,t]of s instanceof Le?s.entries():Object.entries(s))wR.has(e.toLowerCase())?o[e]="[REDACTED]":o[e]=t;return o}var Ts=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 _R(s){if(s==null)return s;let o={};for(let[e,t]of Object.entries(s))Ts.has(e.toLowerCase())?o[e]="[REDACTED]":o[e]=t;return o}function or(s){let o=s.indexOf("://");if(o===-1)return s;let e=o+3,t=s.indexOf("/",e),i=s.indexOf("?",e),a=s.indexOf("#",e),n=Math.min(t===-1?s.length:t,i===-1?s.length:i,a===-1?s.length:a),p=-1;for(let h=e;h<n;h++)s[h]==="@"&&(p=h);if(p!==-1&&(s=`${s.slice(0,e)}[REDACTED]@${s.slice(p+1)}`),i=s.indexOf("?"),i===-1)return s;a=s.indexOf("#",i);let l=a!==-1?a:s.length,c=s.slice(i+1,l);if(c.length===0)return s;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 s;let f=[],u=c.split("&");for(let h of u){let g=h.indexOf("=");if(g===-1){f.push(h);continue}let R=h.slice(0,g),T=Ts.has(R.toLowerCase());if(!T&&R.includes("%"))try{let v=decodeURIComponent(R);T=Ts.has(v.toLowerCase());}catch{}f.push(T?`${R}=[REDACTED]`:h);}return s.slice(0,i+1)+f.join("&")+s.slice(l)}async function zR(s){var e;let o=new Le;if(o.set("Accept",s.responseType==="json"?"application/json":s.responseType==="text"?"text/plain":"*/*"),s.body!==void 0&&s.contentType!=null&&o.set("Content-Type",s.contentType),s.headers==null)return o;for(let[t,i]of Object.entries(s.headers)){let a=await ks.get(i,{endpointMetadata:(e=s.endpointMetadata)!=null?e:{}});if(typeof a=="string"){o.set(t,a);continue}a!=null&&o.set(t,`${a}`);}return o}async function kR(s){var n,p,l;let o=rh(s.url,s.queryParameters),e=await ah({body:s.body,type:(n=s.requestType)!=null?n:"other"}),t=(p=s.fetchFn)!=null?p:await ih(),i=await zR(s),a=Ps(s.logging);if(a.isDebug()){let c={method:s.method,url:or(o),headers:As(i),queryParameters:_R(s.queryParameters),hasBody:e!=null};a.debug("Making HTTP request",c);}try{let c=await lh(async()=>ch(t,o,s.method,i,e,s.timeoutMs,s.abortSignal,s.withCredentials,s.duplex),s.maxRetries);if(c.status>=200&&c.status<400){if(a.isDebug()){let m={method:s.method,url:or(o),statusCode:c.status,responseHeaders:As(c.headers)};a.debug("HTTP request succeeded",m);}return {ok:!0,body:await $i(c,s.responseType),headers:c.headers,rawResponse:Xi(c)}}else {if(a.isError()){let d={method:s.method,url:or(o),statusCode:c.status,responseHeaders:As(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 oh(c)},rawResponse:Xi(c)}}}catch(c){if((l=s.abortSignal)!=null&&l.aborted){if(a.isError()){let d={method:s.method,url:or(o)};a.error("HTTP request was aborted",d);}return {ok:false,error:{reason:"unknown",errorMessage:"The user aborted a request"},rawResponse:Qi}}else if(c instanceof Error&&c.name==="AbortError"){if(a.isError()){let d={method:s.method,url:or(o),timeoutMs:s.timeoutMs};a.error("HTTP request timed out",d);}return {ok:false,error:{reason:"timeout"},rawResponse:Qi}}else if(c instanceof Error){if(a.isError()){let d={method:s.method,url:or(o),errorMessage:c.message};a.error("HTTP request failed with error",d);}return {ok:false,error:{reason:"unknown",errorMessage:c.message},rawResponse:Yi}}if(a.isError()){let d={method:s.method,url:or(o),error:Pe(c)};a.error("HTTP request failed with unknown error",d);}return {ok:false,error:{reason:"unknown",errorMessage:Pe(c)},rawResponse:Yi}}}var k=kR;var _=class s extends Promise{constructor(o){super(e=>{e(void 0);}),this.innerPromise=o;}static fromFunction(o,...e){return new s(o(...e))}static interceptFunction(o){return (...e)=>s.fromPromise(o(...e))}static fromPromise(o){return new s(o)}static fromExecutor(o){let e=new Promise(o);return new s(e)}static fromResult(o){let e=Promise.resolve(o);return new s(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 s=>typeof s=="function"?s():s};var Is={};W(Is,{toBinaryUploadRequest:()=>PR,toMultipartDataPart:()=>vs});async function PR(s){let{data:o,filename:e,contentLength:t,contentType:i}=await js(s),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 vs(s){let{data:o,filename:e,contentType:t}=await js(s,{noSniffFileSize:true});return {data:o,filename:e,contentType:t}}async function js(s,{noSniffFileSize:o}={}){var e,t,i,a,n;if(SR(s))return js({data:s},{noSniffFileSize:o});if("path"in s){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(s.path),c=(e=s.contentLength)!=null?e:o===true?void 0:await mh(s.path),d=(t=s.filename)!=null?t:dh(s.path);return {data:l,filename:d,contentType:s.contentType,contentLength:c}}if("data"in s){let p=s.data,l=(i=s.contentLength)!=null?i:await TR(p,{noSniffFileSize:o}),c=(a=s.filename)!=null?a:AR(p);return {data:p,filename:c,contentType:(n=s.contentType)!=null?n:vR(p),contentLength:l}}throw new Error(`Invalid FileUpload of type ${typeof s}: ${JSON.stringify(s)}`)}function SR(s){return fh(s)||hh(s)||gh(s)||IR(s)||Es(s)||Cs(s)||ER(s)||CR(s)}async function mh(s){try{let o=await import('fs');return !o||!o.promises||!o.promises.stat?void 0:(await o.promises.stat(s)).size}catch{return}}function AR(s){if(jR(s))return s.name;if(uh(s))return dh(s.path.toString())}async function TR(s,{noSniffFileSize:o}={}){if(fh(s))return s.length;if(hh(s)||gh(s))return s.byteLength;if(Es(s)||Cs(s))return s.size;if(o!==true&&uh(s))return await mh(s.path.toString())}function vR(s){if(Es(s)||Cs(s))return s.type}function dh(s){let o=s.lastIndexOf("/"),e=s.lastIndexOf("\\"),t=Math.max(o,e);return t>=0?s.substring(t+1):s}function jR(s){return typeof s=="object"&&s!=null&&"name"in s}function uh(s){return typeof s=="object"&&s!=null&&"path"in s}function ER(s){return typeof s=="object"&&s!=null&&("read"in s||"pipe"in s)}function CR(s){return typeof s=="object"&&s!=null&&"getReader"in s}function fh(s){return typeof Buffer!="undefined"&&Buffer.isBuffer&&Buffer.isBuffer(s)}function hh(s){return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView(s)}function gh(s){return typeof ArrayBuffer!="undefined"&&s instanceof ArrayBuffer}function IR(s){return typeof Uint8Array!="undefined"&&s instanceof Uint8Array}function Es(s){return typeof Blob!="undefined"&&s instanceof Blob}function Cs(s){return typeof File!="undefined"&&s instanceof File}var Tr=DR();function DR(){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 yh(){return new Ds}var Ds=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 vs(e),n=await WR(t,a);i?this.fd.append(o,n,i):this.fd.append(o,n);}getRequest(){return {body:this.fd,headers:{},duplex:"half"}}};function UR(s){return typeof s=="object"&&s!=null&&("read"in s||"pipe"in s)}function bh(s){return typeof s=="object"&&s!=null&&"getReader"in s}function FR(s){return typeof Buffer!="undefined"&&Buffer.isBuffer&&Buffer.isBuffer(s)}function NR(s){return ArrayBuffer.isView(s)}async function MR(s){if(Tr.type==="node"){let{Readable:o}=await import('stream');if(s instanceof o){let e=[];for await(let t of s)e.push(Buffer.isBuffer(t)?t:Buffer.from(t));return Buffer.concat(e)}}if(bh(s)){let o=s.getReader(),e=[];try{for(;;){let{done:n,value:p}=await o.read();if(n)break;e.push(p);}}finally{o.releaseLock();}let t=e.reduce((n,p)=>n+p.length,0),i=new Uint8Array(t),a=0;for(let n of e)i.set(n,a),a+=n.length;return Buffer.from(i)}throw new Error(`Unsupported stream type: ${typeof s}. Expected Node.js Readable stream or Web ReadableStream.`)}async function WR(s,o){if(UR(s)||bh(s)){let e=await MR(s);return new Blob([e],{type:o})}return s instanceof Blob?s:FR(s)?new Blob([s],{type:o}):s instanceof ArrayBuffer?new Blob([s],{type:o}):NR(s)?new Blob([s],{type:o}):typeof s=="string"?new Blob([s],{type:o}):typeof s=="object"&&s!==null?new Blob([Pe(s)],{type:o!=null?o:"application/json"}):new Blob([String(s)],{type:o})}var ct={};W(ct,{ConsoleLogger:()=>rr,LogLevel:()=>fe,Logger:()=>Ar,createLogger:()=>Ps});var r={};W(r,{JsonError:()=>vr,ParseError:()=>jr,any:()=>Ih,bigint:()=>xh,boolean:()=>Dh,booleanLiteral:()=>Eh,date:()=>wh,discriminant:()=>Jh,enum_:()=>Oi,getObjectLikeUtils:()=>Se,getObjectUtils:()=>ir,getSchemaUtils:()=>J,isProperty:()=>He,lazy:()=>_h,lazyObject:()=>vh,list:()=>ea,never:()=>Uh,number:()=>Fh,object:()=>qi,objectWithoutOptionalProperties:()=>Th,optional:()=>Us,property:()=>kh,record:()=>Bh,set:()=>Vh,string:()=>Nh,stringLiteral:()=>Ch,transform:()=>Fs,undiscriminatedUnion:()=>Hh,union:()=>Kh,unknown:()=>Mh,withParsedProperties:()=>Ms});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 H(s,o){return `Expected ${o}. Received ${BR(s)}.`}function BR(s){if(Array.isArray(s))return "list";if(s===null)return "null";if(s instanceof BigInt)return "BigInt";switch(typeof s){case "string":return `"${s}"`;case "bigint":case "number":case "boolean":case "undefined":return `${s}`}return typeof s}function te(s){return {...s,json:Rh(s.json),parse:Rh(s.parse)}}function Rh(s){return (o,e)=>{let t=s(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 Zi(s){return s.path.length===0?s.message:`${s.path.join(" -> ")}: ${s.message}`}var vr=class s extends Error{constructor(e){super(e.map(Zi).join("; "));this.errors=e;Object.setPrototypeOf(this,s.prototype);}};var jr=class s extends Error{constructor(e){super(e.map(Zi).join("; "));this.errors=e;Object.setPrototypeOf(this,s.prototype);}};function J(s){return {nullable:()=>VR(s),optional:()=>Us(s),optionalNullable:()=>LR(s),transform:o=>Fs(s,o),parseOrThrow:(o,e)=>{let t=s.parse(o,e);if(t.ok)return t.value;throw new jr(t.errors)},jsonOrThrow:(o,e)=>{let t=s.json(o,e);if(t.ok)return t.value;throw new vr(t.errors)}}}function VR(s){let o={parse:(e,t)=>e==null?{ok:true,value:null}:s.parse(e,t),json:(e,t)=>e==null?{ok:true,value:null}:s.json(e,t),getType:()=>N.NULLABLE};return {...o,...J(o)}}function Us(s){let o={parse:(e,t)=>e==null?{ok:true,value:void 0}:s.parse(e,t),json:(e,t)=>t!=null&&t.omitUndefined&&e===void 0?{ok:true,value:void 0}:e==null?{ok:true,value:null}:s.json(e,t),getType:()=>N.OPTIONAL};return {...o,...J(o)}}function LR(s){let o={parse:(e,t)=>e===void 0?{ok:true,value:void 0}:e===null?{ok:true,value:null}:s.parse(e,t),json:(e,t)=>e===void 0?{ok:true,value:void 0}:e===null?{ok:true,value:null}:s.json(e,t),getType:()=>N.OPTIONAL_NULLABLE};return {...o,...J(o)}}function Fs(s,o){let e={parse:(t,i)=>{let a=s.parse(t,i);return a.ok?{ok:true,value:o.transform(a.value)}:a},json:(t,i)=>{let a=o.untransform(t);return s.json(a,i)},getType:()=>s.getType()};return {...e,...J(e)}}function xh(){let s={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:H(o,"bigint | number")}]},json:(o,{breadcrumbsPrefix:e=[]}={})=>typeof o!="bigint"?{ok:false,errors:[{path:e,message:H(o,"bigint")}]}:{ok:true,value:o},getType:()=>N.BIGINT};return {...te(s),...J(s)}}var HR=/^([+-]?\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 wh(){let s={parse:(o,{breadcrumbsPrefix:e=[]}={})=>typeof o!="string"?{ok:false,errors:[{path:e,message:H(o,"string")}]}:HR.test(o)?{ok:true,value:new Date(o)}:{ok:false,errors:[{path:e,message:H(o,"ISO 8601 date string")}]},json:(o,{breadcrumbsPrefix:e=[]}={})=>o instanceof Date?{ok:true,value:o.toISOString()}:{ok:false,errors:[{path:e,message:H(o,"Date object")}]},getType:()=>N.DATE};return {...te(s),...J(s)}}function oe(s,o){return ()=>{let e={parse:o,json:o,getType:()=>s};return {...te(e),...J(e)}}}function Oi(s){let o=new Set(s);return oe(N.ENUM,(t,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:a=[]}={})=>typeof t!="string"?{ok:false,errors:[{path:a,message:H(t,"string")}]}:!o.has(t)&&!i?{ok:false,errors:[{path:a,message:H(t,"enum")}]}:{ok:true,value:t})()}function _h(s){let o=Ns(s);return {...o,...J(o)}}function Ns(s){return {parse:(o,e)=>Er(s).parse(o,e),json:(o,e)=>Er(s).json(o,e),getType:()=>Er(s).getType()}}function Er(s){let o=s;return o.__zurg_memoized==null&&(o.__zurg_memoized=s()),o.__zurg_memoized}function lt(s){return Object.entries(s)}function mt(s,o){let e=new Set(o);return Object.entries(s).reduce((t,[i,a])=>(e.has(i)&&(t[i]=a),t),{})}function Ie(s){if(typeof s!="object"||s===null)return false;if(Object.getPrototypeOf(s)===null)return true;let o=s;for(;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return Object.getPrototypeOf(s)===o}function dt(s){return Object.keys(s)}function zh(s,o){let e=[],t=[];for(let i of s)o(i)?e.push(i):t.push(i);return [e,t]}function Se(s){return {withParsedProperties:o=>Ms(s,o)}}function Ms(s,o){let e={parse:(t,i)=>{let a=s.parse(t,i);if(!a.ok)return a;let n=Object.entries(o).reduce((p,[l,c])=>({...p,[l]:typeof c=="function"?c(a.value):c}),{});return {ok:true,value:{...a.value,...n}}},json:(t,i)=>{var p;if(!Ie(t))return {ok:false,errors:[{path:(p=i==null?void 0:i.breadcrumbsPrefix)!=null?p:[],message:H(t,"object")}]};let a=new Set(Object.keys(o)),n=mt(t,Object.keys(t).filter(l=>!a.has(l)));return s.json(n,i)},getType:()=>s.getType()};return {...e,...J(e),...Se(e)}}function kh(s,o){return {rawKey:s,valueSchema:o,isProperty:true}}function He(s){return s.isProperty}function qi(s){let o={_getRawProperties:()=>Object.entries(s).map(([e,t])=>He(t)?t.rawKey:e),_getParsedProperties:()=>dt(s),parse:(e,t)=>{let i={},a=[];for(let[n,p]of lt(s)){let l=He(p)?p.rawKey:n,c=He(p)?p.valueSchema:p,d={rawKey:l,parsedKey:n,valueSchema:c};i[l]=d,Ah(c)&&a.push(l);}return Ph({value:e,requiredKeys:a,getProperty:n=>{let p=i[n];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:[],n]})}}},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,n]of lt(s)){let p=He(n)?n.valueSchema:n;Ah(p)&&i.push(a);}return Ph({value:e,requiredKeys:i,getProperty:a=>{let n=s[a];if(n!=null)return He(n)?{transformedKey:n.rawKey,transform:p=>{var l;return n.valueSchema.json(p,{...t,breadcrumbsPrefix:[...(l=t==null?void 0:t.breadcrumbsPrefix)!=null?l:[],a]})}}:{transformedKey:a,transform:p=>{var l;return n.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),...Se(o),...ir(o)}}function Ph({value:s,requiredKeys:o,getProperty:e,unrecognizedObjectKeys:t="fail",skipValidation:i=false,breadcrumbsPrefix:a=[]}){if(!Ie(s))return {ok:false,errors:[{path:a,message:H(s,"object")}]};let n=new Set(o),p=[],l={};for(let[c,d]of Object.entries(s)){let m=e(c);if(m!=null){n.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=>n.has(c)).map(c=>({path:a,message:`Missing required key "${c}"`}))),p.length===0||i?{ok:true,value:l}:{ok:false,errors:p}}function ir(s){return {extend:o=>{let e={_getParsedProperties:()=>[...s._getParsedProperties(),...o._getParsedProperties()],_getRawProperties:()=>[...s._getRawProperties(),...o._getRawProperties()],parse:(t,i)=>Sh({extensionKeys:o._getRawProperties(),value:t,transformBase:a=>s.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=>s.json(a,i),transformExtension:a=>o.json(a,i),breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),getType:()=>N.OBJECT};return {...e,...J(e),...Se(e),...ir(e)}},passthrough:()=>{let o=new Set(s._getRawProperties()),e=new Set(s._getParsedProperties()),t={_getParsedProperties:()=>s._getParsedProperties(),_getRawProperties:()=>s._getRawProperties(),parse:(i,a)=>{let n=s.parse(i,{...a,unrecognizedObjectKeys:"passthrough"});if(!n.ok)return n;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,...n.value}}},json:(i,a)=>{let n=s.json(i,{...a,unrecognizedObjectKeys:"passthrough"});if(!n.ok)return n;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,...n.value}}},getType:()=>N.OBJECT};return {...t,...J(t),...Se(t),...ir(t)}}}}function Sh({extensionKeys:s,value:o,transformBase:e,transformExtension:t,breadcrumbsPrefix:i=[]}){if(!Ie(o))return {ok:false,errors:[{path:i,message:H(o,"object")}]};let a=new Set(s),[n,p]=zh(dt(o),d=>a.has(d)),l=e(mt(o,p)),c=t(mt(o,n));return l.ok&&c.ok?{ok:true,value:{...l.value,...c.value}}:{ok:false,errors:[...l.ok?[]:l.errors,...c.ok?[]:c.errors]}}function Ah(s){return !JR(s)}function JR(s){switch(s.getType()){case N.ANY:case N.UNKNOWN:case N.OPTIONAL:case N.OPTIONAL_NULLABLE:return true;default:return false}}function Th(s){return qi(s)}function vh(s){let o={...Ns(s),_getRawProperties:()=>Er(s)._getRawProperties(),_getParsedProperties:()=>Er(s)._getParsedProperties()};return {...o,...J(o),...Se(o),...ir(o)}}function ea(s){let o={parse:(e,t)=>jh(e,(i,a)=>{var n;return s.parse(i,{...t,breadcrumbsPrefix:[...(n=t==null?void 0:t.breadcrumbsPrefix)!=null?n:[],`[${a}]`]})}),json:(e,t)=>jh(e,(i,a)=>{var n;return s.json(i,{...t,breadcrumbsPrefix:[...(n=t==null?void 0:t.breadcrumbsPrefix)!=null?n:[],`[${a}]`]})}),getType:()=>N.LIST};return {...te(o),...J(o)}}function jh(s,o){return Array.isArray(s)?s.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:H(s,"list"),path:[]}]}}function Eh(s){return oe(N.BOOLEAN_LITERAL,(e,{breadcrumbsPrefix:t=[]}={})=>e===s?{ok:true,value:s}:{ok:false,errors:[{path:t,message:H(e,`${s.toString()}`)}]})()}function Ch(s){return oe(N.STRING_LITERAL,(e,{breadcrumbsPrefix:t=[]}={})=>e===s?{ok:true,value:s}:{ok:false,errors:[{path:t,message:H(e,`"${s}"`)}]})()}var Ih=oe(N.ANY,s=>({ok:true,value:s}));var Dh=oe(N.BOOLEAN,(s,{breadcrumbsPrefix:o=[]}={})=>typeof s=="boolean"?{ok:true,value:s}:{ok:false,errors:[{path:o,message:H(s,"boolean")}]});var Uh=oe(N.NEVER,(s,{breadcrumbsPrefix:o=[]}={})=>({ok:false,errors:[{path:o,message:"Expected never"}]}));var Fh=oe(N.NUMBER,(s,{breadcrumbsPrefix:o=[]}={})=>typeof s=="number"?{ok:true,value:s}:{ok:false,errors:[{path:o,message:H(s,"number")}]});var Nh=oe(N.STRING,(s,{breadcrumbsPrefix:o=[]}={})=>typeof s=="string"?{ok:true,value:s}:{ok:false,errors:[{path:o,message:H(s,"string")}]});var Mh=oe(N.UNKNOWN,s=>({ok:true,value:s}));function Bh(s,o){let e={parse:(t,i)=>Wh({value:t,isKeyNumeric:s.getType()===N.NUMBER,transformKey:a=>{var n;return s.parse(a,{...i,breadcrumbsPrefix:[...(n=i==null?void 0:i.breadcrumbsPrefix)!=null?n:[],`${a} (key)`]})},transformValue:(a,n)=>{var p;return o.parse(a,{...i,breadcrumbsPrefix:[...(p=i==null?void 0:i.breadcrumbsPrefix)!=null?p:[],`${n}`]})},breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),json:(t,i)=>Wh({value:t,isKeyNumeric:s.getType()===N.NUMBER,transformKey:a=>{var n;return s.json(a,{...i,breadcrumbsPrefix:[...(n=i==null?void 0:i.breadcrumbsPrefix)!=null?n:[],`${a} (key)`]})},transformValue:(a,n)=>{var p;return o.json(a,{...i,breadcrumbsPrefix:[...(p=i==null?void 0:i.breadcrumbsPrefix)!=null?p:[],`${n}`]})},breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),getType:()=>N.RECORD};return {...te(e),...J(e)}}function Wh({value:s,isKeyNumeric:o,transformKey:e,transformValue:t,breadcrumbsPrefix:i=[]}){return Ie(s)?lt(s).reduce((a,[n,p])=>{if(p===void 0)return a;let l=a,c=n;if(o){let u=n.length>0?Number(n):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:H(s,"object")}]}}function Vh(s){let o=ea(s),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 n;return t instanceof Set?o.json([...t],i):{ok:false,errors:[{path:(n=i==null?void 0:i.breadcrumbsPrefix)!=null?n:[],message:H(t,"Set")}]}},getType:()=>N.SET};return {...te(e),...J(e)}}function Hh(s){let o={parse:(e,t)=>Lh((i,a)=>i.parse(e,a),s,t),json:(e,t)=>Lh((i,a)=>i.json(e,a),s,t),getType:()=>N.UNDISCRIMINATED_UNION};return {...te(o),...J(o)}}function Lh(s,o,e){let t=[];for(let[i,a]of o.entries()){let n=s(a,{...e,skipValidation:false});if(n.ok)return n;for(let p of n.errors)t.push({path:p.path,message:`[Variant ${i}] ${p.message}`});}return {ok:false,errors:t}}function Jh(s,o){return {parsedDiscriminant:s,rawDiscriminant:o}}function Kh(s,o){let e=typeof s=="string"?s:s.rawDiscriminant,t=typeof s=="string"?s:s.parsedDiscriminant,i=Oi(dt(o)),a={parse:(n,p)=>Gh({value:n,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:(n,p)=>Gh({value:n,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),...Se(a)}}function Gh({value:s,discriminant:o,transformedDiscriminant:e,transformDiscriminantValue:t,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:a=false,transformAdditionalProperties:n,breadcrumbsPrefix:p=[]}){if(!Ie(s))return {ok:false,errors:[{path:p,message:H(s,"object")}]};let{[o]:l,...c}=s;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=n(c,m);return f.ok?{ok:true,value:{[e]:l,...f.value}}:f}var x={};W(x,{encodePathParam:()=>$h,join:()=>Yh,toQueryString:()=>tr});function $h(s){if(s===null)return "null";switch(typeof s){case "undefined":return "undefined";case "string":case "number":case "boolean":break;default:s=String(s);break}return encodeURIComponent(s)}function Yh(s,...o){if(!s)return "";if(o.length===0)return s;if(s.includes("://")){let e;try{e=new URL(s);}catch{return Qh(s,...o)}let t=o[o.length-1],i=t==null?void 0:t.endsWith("/");for(let a of o){let n=Zh(a);n&&(e.pathname=Xh(e.pathname,n));}return i&&!e.pathname.endsWith("/")&&(e.pathname+="/"),e.toString()}return Qh(s,...o)}function Qh(s,...o){if(o.length===0)return s;let e=s,t=o[o.length-1],i=t==null?void 0:t.endsWith("/");for(let a of o){let n=Zh(a);n&&(e=Xh(e,n));}return i&&!e.endsWith("/")&&(e+="/"),e}function Xh(s,o){return s.endsWith("/")?s+o:`${s}/${o}`}function Zh(s){if(!s)return s;let o=0,e=s.length;return s.startsWith("/")&&(o=1),s.endsWith("/")&&(e=s.length-1),o===0&&e===s.length?s:s.slice(o,e)}function F(s){let o=z({"X-Fern-Language":"JavaScript","X-Fern-Runtime":Tr.type,"X-Fern-Runtime-Version":Tr.version,"Comet-Workspace":s==null?void 0:s.workspaceName},s==null?void 0:s.headers);return {...s,logging:ct.createLogger(s==null?void 0:s.logging),headers:o}}var P={Default:"http://localhost:5173/api"};function A(s,o,e,t){switch(s.reason){case "non-json":throw new w({statusCode:s.statusCode,body:s.rawBody,rawResponse:o});case "body-is-null":throw new w({statusCode:s.statusCode,rawResponse:o});case "timeout":throw new Pr(`Timeout exceeded when calling ${e} ${t}.`);case "unknown":throw new w({message:s.errorMessage,rawResponse:o});default:throw new w({message:"Unknown error",rawResponse:o})}}var L={};W(L,{AggregationData:()=>Cp,Alert:()=>OR,AlertAlertType:()=>Ip,AlertPagePublic:()=>Gp,AlertPublic:()=>To,AlertPublicAlertType:()=>Wp,AlertTrigger:()=>Np,AlertTriggerConfig:()=>Up,AlertTriggerConfigPublic:()=>Vp,AlertTriggerConfigPublicType:()=>Bp,AlertTriggerConfigType:()=>Dp,AlertTriggerConfigWrite:()=>$p,AlertTriggerConfigWriteType:()=>Kp,AlertTriggerEventType:()=>Fp,AlertTriggerPublic:()=>Hp,AlertTriggerPublicEventType:()=>Lp,AlertTriggerWrite:()=>Yp,AlertTriggerWriteEventType:()=>Qp,AlertWrite:()=>vo,AlertWriteAlertType:()=>Xp,AnnotationQueue:()=>ec,AnnotationQueueBatch:()=>qR,AnnotationQueueBatchWrite:()=>ft,AnnotationQueueItemIds:()=>Ha,AnnotationQueuePagePublic:()=>oc,AnnotationQueuePublic:()=>jo,AnnotationQueuePublicScope:()=>rc,AnnotationQueueReviewer:()=>Op,AnnotationQueueReviewerPublic:()=>tc,AnnotationQueueScope:()=>qp,AnnotationQueueUpdate:()=>ht,AnnotationQueueWrite:()=>ut,AnnotationQueueWriteScope:()=>Ws,AssistantMessage:()=>nc,AssistantMessageRole:()=>ic,Attachment:()=>sc,AttachmentListRequestEntityType:()=>na,AttachmentPage:()=>pc,AudioUrl:()=>cc,AudioUrlPublic:()=>lc,AudioUrlWrite:()=>mc,AuthDetailsHolder:()=>dc,AutomationRuleEvaluator:()=>ex,AutomationRuleEvaluatorAction:()=>uc,AutomationRuleEvaluatorLlmAsJudge:()=>xc,AutomationRuleEvaluatorLlmAsJudgePublic:()=>Mo,AutomationRuleEvaluatorLlmAsJudgeWrite:()=>Vc,AutomationRuleEvaluatorObjectObjectPublic:()=>Qc,AutomationRuleEvaluatorObjectObjectPublicAction:()=>Lc,AutomationRuleEvaluatorPagePublic:()=>Yc,AutomationRuleEvaluatorPublic:()=>Zc,AutomationRuleEvaluatorPublicAction:()=>Xc,AutomationRuleEvaluatorSpanLlmAsJudge:()=>_c,AutomationRuleEvaluatorSpanLlmAsJudgePublic:()=>Bo,AutomationRuleEvaluatorSpanLlmAsJudgeWrite:()=>el,AutomationRuleEvaluatorSpanUserDefinedMetricPython:()=>zc,AutomationRuleEvaluatorSpanUserDefinedMetricPythonPublic:()=>Vo,AutomationRuleEvaluatorSpanUserDefinedMetricPythonWrite:()=>tl,AutomationRuleEvaluatorTraceThreadLlmAsJudge:()=>kc,AutomationRuleEvaluatorTraceThreadLlmAsJudgePublic:()=>Lo,AutomationRuleEvaluatorTraceThreadLlmAsJudgeWrite:()=>al,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPython:()=>Pc,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonPublic:()=>Ho,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonWrite:()=>sl,AutomationRuleEvaluatorUpdate:()=>hl,AutomationRuleEvaluatorUpdateAction:()=>pl,AutomationRuleEvaluatorUpdateLlmAsJudge:()=>cl,AutomationRuleEvaluatorUpdateSpanLlmAsJudge:()=>ll,AutomationRuleEvaluatorUpdateSpanUserDefinedMetricPython:()=>ml,AutomationRuleEvaluatorUpdateTraceThreadLlmAsJudge:()=>dl,AutomationRuleEvaluatorUpdateTraceThreadUserDefinedMetricPython:()=>ul,AutomationRuleEvaluatorUpdateUserDefinedMetricPython:()=>fl,AutomationRuleEvaluatorUserDefinedMetricPython:()=>Sc,AutomationRuleEvaluatorUserDefinedMetricPythonPublic:()=>Jo,AutomationRuleEvaluatorUserDefinedMetricPythonWrite:()=>yl,AutomationRuleEvaluatorWrite:()=>Rl,AutomationRuleEvaluatorWriteAction:()=>bl,AvgValueStatPublic:()=>xl,BatchDelete:()=>X,BatchDeleteByProject:()=>rx,BiInformation:()=>wl,BiInformationResponse:()=>Hr,BooleanFeedbackDefinition:()=>zl,BooleanFeedbackDefinitionCreate:()=>Pl,BooleanFeedbackDefinitionPublic:()=>Qo,BooleanFeedbackDefinitionUpdate:()=>Tl,BooleanFeedbackDetail:()=>_l,BooleanFeedbackDetailCreate:()=>kl,BooleanFeedbackDetailPublic:()=>Sl,BooleanFeedbackDetailUpdate:()=>Al,BreakdownConfigPublic:()=>Rp,BreakdownConfigPublicField:()=>bp,CategoricalFeedbackDefinition:()=>jl,CategoricalFeedbackDefinitionCreate:()=>Cl,CategoricalFeedbackDefinitionPublic:()=>Yo,CategoricalFeedbackDefinitionUpdate:()=>Ul,CategoricalFeedbackDetail:()=>vl,CategoricalFeedbackDetailCreate:()=>El,CategoricalFeedbackDetailPublic:()=>Il,CategoricalFeedbackDetailUpdate:()=>Dl,ChatCompletionChoice:()=>Nl,ChatCompletionRequest:()=>bt,ChatCompletionResponse:()=>Vl,Check:()=>Jl,CheckName:()=>Ll,CheckPublic:()=>$l,CheckPublicName:()=>Gl,CheckPublicResult:()=>Kl,CheckResult:()=>Hl,ChunkedOutputJsonNode:()=>tx,ChunkedOutputJsonNodePublic:()=>ox,ChunkedOutputJsonNodePublicType:()=>Yl,ChunkedOutputJsonNodeType:()=>Ql,Column:()=>Zl,ColumnCompare:()=>ql,ColumnCompareTypesItem:()=>Ol,ColumnPublic:()=>rm,ColumnPublicTypesItem:()=>em,ColumnTypesItem:()=>Xl,Comment:()=>O,CommentCompare:()=>tm,CommentPublic:()=>yr,CompleteMultipartUploadRequest:()=>Ja,CompleteMultipartUploadRequestEntityType:()=>om,CompletionTokensDetails:()=>Ml,CountValueStatPublic:()=>am,CreateDatasetItemsFromSpansRequest:()=>wt,CreateDatasetItemsFromTracesRequest:()=>_t,CreatePromptVersionDetail:()=>oo,CreatePromptVersionDetailTemplateStructure:()=>Ea,DashboardPagePublic:()=>nm,DashboardPublic:()=>br,DashboardUpdatePublic:()=>Rt,DashboardWrite:()=>xt,DataPointDouble:()=>ix,DataPointNumberPublic:()=>sm,Dataset:()=>ax,DatasetExpansion:()=>nx,DatasetExpansionResponse:()=>mm,DatasetExpansionWrite:()=>zt,DatasetExportJobPublic:()=>Ir,DatasetExportJobPublicStatus:()=>Os,DatasetIdentifier:()=>kt,DatasetIdentifierPublic:()=>Pt,DatasetItem:()=>Zo,DatasetItemBatch:()=>sx,DatasetItemBatchUpdate:()=>At,DatasetItemBatchWrite:()=>vt,DatasetItemChangesPublic:()=>dm,DatasetItemCompare:()=>xm,DatasetItemCompareSource:()=>um,DatasetItemFilter:()=>St,DatasetItemFilterOperator:()=>Ys,DatasetItemPageCompare:()=>wm,DatasetItemPagePublic:()=>km,DatasetItemPublic:()=>qo,DatasetItemPublicSource:()=>_m,DatasetItemSource:()=>lm,DatasetItemStreamRequest:()=>jt,DatasetItemUpdate:()=>Xs,DatasetItemWrite:()=>Tt,DatasetItemWriteSource:()=>Zs,DatasetItemsDelete:()=>Et,DatasetPagePublic:()=>Am,DatasetPublic:()=>Jr,DatasetPublicStatus:()=>Pm,DatasetPublicVisibility:()=>Sm,DatasetStatus:()=>pm,DatasetUpdate:()=>Ct,DatasetUpdateVisibility:()=>ma,DatasetVersionDiff:()=>vm,DatasetVersionDiffStats:()=>Tm,DatasetVersionPagePublic:()=>jm,DatasetVersionPublic:()=>Je,DatasetVersionRestorePublic:()=>It,DatasetVersionRetrieveRequestPublic:()=>Dt,DatasetVersionSummary:()=>Xo,DatasetVersionSummaryPublic:()=>ei,DatasetVersionTag:()=>Ut,DatasetVersionUpdatePublic:()=>Ft,DatasetVisibility:()=>cm,DatasetWrite:()=>Nt,DatasetWriteVisibility:()=>da,DeleteAttachmentsRequest:()=>px,DeleteAttachmentsRequestEntityType:()=>Em,DeleteFeedbackScore:()=>ri,DeleteIdsHolder:()=>Gr,DeleteThreadFeedbackScores:()=>ho,DeleteTraceThreads:()=>go,Delta:()=>Fl,DownloadAttachmentRequestEntityType:()=>sa,ErrorCountWithDeviation:()=>ti,ErrorCountWithDeviationDetailed:()=>Cm,ErrorInfo:()=>Ne,ErrorInfoExperimentItemBulkWriteView:()=>Vt,ErrorInfoPublic:()=>oi,ErrorInfoWrite:()=>lo,ErrorMessage:()=>ae,ErrorMessageDetail:()=>cx,ErrorMessageDetailed:()=>lx,ErrorMessagePublic:()=>mx,Experiment:()=>dx,ExperimentBatchUpdate:()=>Bt,ExperimentGroupAggregationsResponse:()=>Fm,ExperimentGroupResponse:()=>Bm,ExperimentItem:()=>Jt,ExperimentItemBulkRecord:()=>Gm,ExperimentItemBulkRecordExperimentItemBulkWriteView:()=>pp,ExperimentItemBulkUpload:()=>ux,ExperimentItemBulkUploadExperimentItemBulkWriteView:()=>Lt,ExperimentItemCompare:()=>Rm,ExperimentItemCompareTraceVisibilityMode:()=>fm,ExperimentItemPublic:()=>Oo,ExperimentItemPublicTraceVisibilityMode:()=>zm,ExperimentItemReference:()=>Lm,ExperimentItemReferencePublic:()=>Km,ExperimentItemStreamRequest:()=>Ht,ExperimentItemTraceVisibilityMode:()=>cp,ExperimentItemsBatch:()=>Gt,ExperimentItemsDelete:()=>Kt,ExperimentPagePublic:()=>Xm,ExperimentPublic:()=>si,ExperimentPublicStatus:()=>$m,ExperimentPublicType:()=>Qm,ExperimentScore:()=>Mt,ExperimentScorePublic:()=>Ym,ExperimentScoreWrite:()=>up,ExperimentStatus:()=>Im,ExperimentStreamRequestPublic:()=>$t,ExperimentType:()=>Dm,ExperimentUpdate:()=>Wt,ExperimentUpdateStatus:()=>qs,ExperimentUpdateType:()=>ep,ExperimentWrite:()=>Qt,ExperimentWriteStatus:()=>ha,ExperimentWriteType:()=>ga,ExportTraceServiceRequest:()=>fx,Feedback:()=>hx,FeedbackCreate:()=>od,FeedbackDefinitionPagePublic:()=>sd,FeedbackObjectPublic:()=>nd,FeedbackPublic:()=>cd,FeedbackScore:()=>pe,FeedbackScoreAverage:()=>de,FeedbackScoreAverageDetailed:()=>ld,FeedbackScoreAveragePublic:()=>sr,FeedbackScoreBatch:()=>ci,FeedbackScoreBatchItem:()=>dd,FeedbackScoreBatchItemSource:()=>md,FeedbackScoreBatchItemThread:()=>jp,FeedbackScoreBatchItemThreadSource:()=>vp,FeedbackScoreBatchThread:()=>yo,FeedbackScoreCompare:()=>bm,FeedbackScoreCompareSource:()=>hm,FeedbackScoreExperimentItemBulkWriteView:()=>ip,FeedbackScoreExperimentItemBulkWriteViewSource:()=>rp,FeedbackScoreNames:()=>fd,FeedbackScorePublic:()=>Kr,FeedbackScorePublicSource:()=>hd,FeedbackScoreSource:()=>lp,FeedbackUpdate:()=>wd,FindFeedbackDefinitionsRequestType:()=>ba,FindFeedbackScoreNames1RequestType:()=>Na,Function:()=>yt,FunctionCall:()=>De,GetSpanStatsRequestType:()=>Ma,GetSpansByProjectRequestType:()=>Wa,GetWebhookExamplesRequestAlertType:()=>ra,GroupContent:()=>Nm,GroupContentWithAggregations:()=>Um,GroupDetail:()=>Mm,GroupDetails:()=>Wm,Guardrail:()=>kd,GuardrailBatch:()=>gx,GuardrailBatchWrite:()=>Yt,GuardrailName:()=>_d,GuardrailResult:()=>zd,GuardrailWrite:()=>gp,GuardrailWriteName:()=>fp,GuardrailWriteResult:()=>hp,GuardrailsValidation:()=>Hm,GuardrailsValidationPublic:()=>Pd,IdsHolder:()=>yx,ImageUrl:()=>fc,ImageUrlPublic:()=>Tc,ImageUrlWrite:()=>Dc,JsonListString:()=>K,JsonListStringCompare:()=>Ga,JsonListStringExperimentItemBulkWriteView:()=>Ae,JsonListStringPublic:()=>ye,JsonListStringWrite:()=>ge,JsonNode:()=>V,JsonNodeDetail:()=>zp,JsonNodePublic:()=>ce,JsonNodeWrite:()=>he,JsonSchema:()=>Vs,LlmAsJudgeCode:()=>Co,LlmAsJudgeCodePublic:()=>Ic,LlmAsJudgeCodeWrite:()=>Wc,LlmAsJudgeMessage:()=>pr,LlmAsJudgeMessageContent:()=>gc,LlmAsJudgeMessageContentPublic:()=>jc,LlmAsJudgeMessageContentWrite:()=>Fc,LlmAsJudgeMessagePublic:()=>mr,LlmAsJudgeMessagePublicRole:()=>Ec,LlmAsJudgeMessageRole:()=>yc,LlmAsJudgeMessageWrite:()=>fr,LlmAsJudgeMessageWriteRole:()=>Nc,LlmAsJudgeModelParameters:()=>cr,LlmAsJudgeModelParametersPublic:()=>dr,LlmAsJudgeModelParametersWrite:()=>hr,LlmAsJudgeOutputSchema:()=>lr,LlmAsJudgeOutputSchemaPublic:()=>ur,LlmAsJudgeOutputSchemaPublicType:()=>Cc,LlmAsJudgeOutputSchemaType:()=>bc,LlmAsJudgeOutputSchemaWrite:()=>gr,LlmAsJudgeOutputSchemaWriteType:()=>Mc,LogItem:()=>Ad,LogItemLevel:()=>Sd,LogPage:()=>Td,ManualEvaluationRequest:()=>li,ManualEvaluationRequestEntityType:()=>vd,ManualEvaluationResponse:()=>mi,Message:()=>Bs,MultipartUploadPart:()=>im,NumericalFeedbackDefinition:()=>Om,NumericalFeedbackDefinitionCreate:()=>rd,NumericalFeedbackDefinitionPublic:()=>pi,NumericalFeedbackDefinitionUpdate:()=>Rd,NumericalFeedbackDetail:()=>Zm,NumericalFeedbackDetailCreate:()=>ed,NumericalFeedbackDetailPublic:()=>id,NumericalFeedbackDetailUpdate:()=>bd,OllamaConnectionTestResponse:()=>Qa,OllamaInstanceBaseUrlRequest:()=>Ya,OllamaModel:()=>yp,Optimization:()=>bx,OptimizationPagePublic:()=>Kd,OptimizationPublic:()=>di,OptimizationPublicStatus:()=>Md,OptimizationStatus:()=>jd,OptimizationStudioConfig:()=>Nd,OptimizationStudioConfigPublic:()=>Gd,OptimizationStudioConfigWrite:()=>qd,OptimizationStudioLog:()=>eu,OptimizationUpdate:()=>Ot,OptimizationUpdateStatus:()=>ka,OptimizationWrite:()=>Xa,OptimizationWriteStatus:()=>ru,PageColumns:()=>tu,PercentageValueStatPublic:()=>ou,PercentageValues:()=>Me,PercentageValuesDetailed:()=>iu,PercentageValuesPublic:()=>ni,Project:()=>Rx,ProjectDetailed:()=>su,ProjectDetailedVisibility:()=>nu,ProjectMetricRequestPublic:()=>qt,ProjectMetricRequestPublicInterval:()=>Sa,ProjectMetricRequestPublicMetricType:()=>Aa,ProjectMetricResponsePublic:()=>mu,ProjectMetricResponsePublicInterval:()=>pu,ProjectMetricResponsePublicMetricType:()=>cu,ProjectPagePublic:()=>uu,ProjectPublic:()=>ui,ProjectPublicVisibility:()=>du,ProjectReference:()=>Ac,ProjectReferencePublic:()=>Go,ProjectRetrieveDetailed:()=>eo,ProjectStatItemObjectPublic:()=>hu,ProjectStatsPublic:()=>Ge,ProjectStatsSummary:()=>yu,ProjectStatsSummaryItem:()=>gu,ProjectUpdate:()=>ro,ProjectUpdateVisibility:()=>Ta,ProjectVisibility:()=>au,ProjectWrite:()=>to,ProjectWriteVisibility:()=>va,Prompt:()=>xx,PromptDetail:()=>ku,PromptDetailTemplateStructure:()=>zu,PromptPagePublic:()=>Au,PromptPublic:()=>Su,PromptPublicTemplateStructure:()=>Pu,PromptTemplateStructure:()=>bu,PromptTokensDetails:()=>Wl,PromptType:()=>Ru,PromptUpdatable:()=>io,PromptVersion:()=>_u,PromptVersionBatchUpdate:()=>ao,PromptVersionDetail:()=>Ee,PromptVersionDetailTemplateStructure:()=>kp,PromptVersionDetailType:()=>Pp,PromptVersionLink:()=>Ka,PromptVersionLinkPublic:()=>$a,PromptVersionLinkWrite:()=>fa,PromptVersionPagePublic:()=>Eu,PromptVersionPublic:()=>ju,PromptVersionPublicTemplateStructure:()=>Tu,PromptVersionPublicType:()=>vu,PromptVersionRetrieveDetail:()=>no,PromptVersionTemplateStructure:()=>xu,PromptVersionType:()=>wu,PromptVersionUpdate:()=>Sp,PromptWrite:()=>so,PromptWriteTemplateStructure:()=>Ca,PromptWriteType:()=>Ia,ProviderApiKey:()=>wx,ProviderApiKeyPagePublic:()=>Du,ProviderApiKeyProvider:()=>Cu,ProviderApiKeyPublic:()=>fi,ProviderApiKeyPublicProvider:()=>Iu,ProviderApiKeyUpdate:()=>Xt,ProviderApiKeyWrite:()=>Zt,ProviderApiKeyWriteProvider:()=>wa,ResponseFormat:()=>Hs,ResponseFormatType:()=>Ls,Result:()=>Rr,ResultsNumberPublic:()=>lu,ScoreName:()=>ud,ServiceTogglesConfig:()=>Uu,Span:()=>ii,SpanBatch:()=>_x,SpanBatchUpdate:()=>co,SpanBatchWrite:()=>uo,SpanEnrichmentOptions:()=>$s,SpanExperimentItemBulkWriteView:()=>np,SpanExperimentItemBulkWriteViewType:()=>ap,SpanFilter:()=>Be,SpanFilterOperator:()=>wc,SpanFilterPublic:()=>Ue,SpanFilterPublicOperator:()=>xp,SpanFilterWrite:()=>Ko,SpanFilterWriteOperator:()=>Oc,SpanLlmAsJudgeCode:()=>Io,SpanLlmAsJudgeCodePublic:()=>Hc,SpanLlmAsJudgeCodeWrite:()=>qc,SpanPagePublic:()=>Nu,SpanPublic:()=>hi,SpanPublicType:()=>Fu,SpanSearchStreamRequestPublic:()=>fo,SpanSearchStreamRequestPublicType:()=>Ua,SpanType:()=>Vm,SpanUpdate:()=>po,SpanUpdateType:()=>Ap,SpanUserDefinedMetricPythonCode:()=>Do,SpanUserDefinedMetricPythonCodePublic:()=>Jc,SpanUserDefinedMetricPythonCodeWrite:()=>rl,SpanWrite:()=>mo,SpanWriteType:()=>Tp,SpansCountResponse:()=>Wu,StartMultipartUploadRequest:()=>gt,StartMultipartUploadRequestEntityType:()=>ia,StartMultipartUploadResponse:()=>Bu,StreamOptions:()=>Js,StudioEvaluation:()=>Cd,StudioEvaluationPublic:()=>Bd,StudioEvaluationWrite:()=>Qd,StudioLlmModel:()=>Id,StudioLlmModelPublic:()=>Vd,StudioLlmModelWrite:()=>Yd,StudioMessage:()=>Ud,StudioMessagePublic:()=>Hd,StudioMessageWrite:()=>Zd,StudioMetric:()=>Ed,StudioMetricPublic:()=>Wd,StudioMetricWrite:()=>$d,StudioOptimizer:()=>Dd,StudioOptimizerPublic:()=>Ld,StudioOptimizerWrite:()=>Xd,StudioPrompt:()=>Fd,StudioPromptPublic:()=>Jd,StudioPromptWrite:()=>Od,TokenUsageNames:()=>Vu,Tool:()=>Ks,ToolCall:()=>Eo,ToolCallType:()=>ac,ToolType:()=>Gs,Trace:()=>ai,TraceBatch:()=>zx,TraceBatchUpdate:()=>Ro,TraceBatchWrite:()=>wo,TraceCountResponse:()=>Hu,TraceEnrichmentOptions:()=>Qs,TraceExperimentItemBulkWriteView:()=>sp,TraceFilter:()=>We,TraceFilterOperator:()=>Rc,TraceFilterPublic:()=>Fe,TraceFilterPublicOperator:()=>wp,TraceFilterWrite:()=>Wo,TraceFilterWriteOperator:()=>Bc,TracePagePublic:()=>Gu,TracePublic:()=>gi,TracePublicVisibilityMode:()=>Ju,TraceSearchStreamRequestPublic:()=>_o,TraceThread:()=>yi,TraceThreadBatchIdentifier:()=>zo,TraceThreadBatchUpdate:()=>Po,TraceThreadFilter:()=>Te,TraceThreadFilterOperator:()=>Ep,TraceThreadFilterPublic:()=>ar,TraceThreadFilterPublicOperator:()=>_p,TraceThreadFilterWrite:()=>$o,TraceThreadFilterWriteOperator:()=>ol,TraceThreadIdentifier:()=>Za,TraceThreadLlmAsJudgeCode:()=>Uo,TraceThreadLlmAsJudgeCodePublic:()=>Gc,TraceThreadLlmAsJudgeCodeWrite:()=>il,TraceThreadPage:()=>$u,TraceThreadSearchStreamRequest:()=>So,TraceThreadStatus:()=>Ku,TraceThreadUpdate:()=>ko,TraceThreadUserDefinedMetricPythonCode:()=>Fo,TraceThreadUserDefinedMetricPythonCodePublic:()=>Kc,TraceThreadUserDefinedMetricPythonCodeWrite:()=>nl,TraceUpdate:()=>bo,TraceVisibilityMode:()=>Jm,TraceWrite:()=>xo,UploadAttachmentRequestEntityType:()=>pa,Usage:()=>Bl,UserDefinedMetricPythonCode:()=>No,UserDefinedMetricPythonCodePublic:()=>$c,UserDefinedMetricPythonCodeWrite:()=>gl,ValueEntry:()=>dp,ValueEntryCompare:()=>ym,ValueEntryCompareSource:()=>gm,ValueEntryExperimentItemBulkWriteView:()=>op,ValueEntryExperimentItemBulkWriteViewSource:()=>tp,ValueEntryPublic:()=>yd,ValueEntryPublicSource:()=>gd,ValueEntrySource:()=>mp,VideoUrl:()=>hc,VideoUrlPublic:()=>vc,VideoUrlWrite:()=>Uc,Webhook:()=>Mp,WebhookExamples:()=>Qu,WebhookPublic:()=>Jp,WebhookTestResult:()=>Xu,WebhookTestResultStatus:()=>Yu,WebhookWrite:()=>Zp,WelcomeWizardSubmission:()=>Ao,WelcomeWizardTracking:()=>Zu,WorkspaceConfiguration:()=>bi,WorkspaceMetricRequest:()=>kx,WorkspaceMetricResponse:()=>Oa,WorkspaceMetricsSummaryRequest:()=>$r,WorkspaceMetricsSummaryResponse:()=>Ou,WorkspaceNameHolder:()=>qu,WorkspaceSpansCount:()=>Mu,WorkspaceTraceCount:()=>Lu,alerts:()=>ta,annotationQueues:()=>oa,attachments:()=>Cr,chatCompletions:()=>ca,dashboards:()=>la,datasets:()=>Dr,experiments:()=>Ur,feedbackDefinitions:()=>Ra,guardrails:()=>xa,llmProviderKey:()=>_a,ollama:()=>Fr,optimizations:()=>Pa,projects:()=>ja,prompts:()=>Da,spans:()=>Nr,traces:()=>nr,welcomeWizard:()=>La});var ta={};W(ta,{GetWebhookExamplesRequestAlertType:()=>ra});var ra=r.enum_(["general","slack","pagerduty"]);var Ws=r.enum_(["trace","thread"]);var ut=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:Ws,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional())});var ft=r.object({annotationQueues:r.property("annotation_queues",r.list(ut))});var ht=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 oa={};W(oa,{AnnotationQueueBatchWrite:()=>ft,AnnotationQueueUpdate:()=>ht});var ia=r.enum_(["trace","span"]);var gt=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",ia),entityId:r.property("entity_id",r.string()),path:r.string()});var Cr={};W(Cr,{AttachmentListRequestEntityType:()=>na,DownloadAttachmentRequestEntityType:()=>sa,StartMultipartUploadRequest:()=>gt,StartMultipartUploadRequestEntityType:()=>ia,UploadAttachmentRequestEntityType:()=>pa,uploadAttachment:()=>aa});var aa={};W(aa,{Request:()=>GR});var GR=r.record(r.string(),r.unknown());var na=r.enum_(["trace","span"]);var sa=r.enum_(["trace","span"]);var pa=r.enum_(["trace","span"]);var yt=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 Bs=r.record(r.string(),r.unknown());var Vs=r.object({name:r.string().optional(),strict:r.boolean().optional(),schema:r.record(r.string(),r.record(r.string(),r.unknown())).optional()});var Ls=r.enum_(["text","json_object","json_schema"]);var Hs=r.object({type:Ls.optional(),jsonSchema:r.property("json_schema",Vs.optional())});var Js=r.object({includeUsage:r.property("include_usage",r.boolean().optional())});var Gs=r.enum_(["function"]);var Ks=r.object({type:Gs.optional(),function:yt.optional()});var bt=r.object({model:r.string().optional(),messages:r.list(Bs).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",Js.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",Hs.optional()),seed:r.number().optional(),tools:r.list(Ks).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(yt).optional(),functionCall:r.property("function_call",De.optional())});var ca={};W(ca,{ChatCompletionRequest:()=>bt});var ce=r.record(r.string(),r.unknown());var Rt=r.object({name:r.string().optional(),description:r.string().optional(),config:ce.optional()});var he=r.record(r.string(),r.unknown());var xt=r.object({name:r.string(),description:r.string().optional(),config:he});var la={};W(la,{DashboardUpdatePublic:()=>Rt,DashboardWrite:()=>xt});var $s=r.object({includeTags:r.boolean().optional(),includeFeedbackScores:r.boolean().optional(),includeComments:r.boolean().optional(),includeUsage:r.boolean().optional(),includeMetadata:r.boolean().optional()});var wt=r.object({spanIds:r.property("span_ids",r.list(r.string())),enrichmentOptions:r.property("enrichment_options",$s)});var Qs=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 _t=r.object({traceIds:r.property("trace_ids",r.list(r.string())),enrichmentOptions:r.property("enrichment_options",Qs)});var zt=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 kt=r.object({datasetName:r.property("dataset_name",r.string())});var Pt=r.object({datasetName:r.property("dataset_name",r.string())});var Ys=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var St=r.object({field:r.string().optional(),operator:Ys.optional(),key:r.string().optional(),value:r.string().optional()});var V=r.record(r.string(),r.unknown());var Xs=r.object({input:r.string().optional(),expectedOutput:r.property("expected_output",r.string().optional()),metadata:V.optional(),data:V.optional(),tags:r.list(r.string()).optional()});var At=r.object({ids:r.list(r.string()).optional(),filters:r.list(St).optional(),datasetId:r.property("dataset_id",r.string().optional()),update:Xs,mergeTags:r.property("merge_tags",r.boolean().optional())});var Zs=r.enum_(["manual","trace","span","sdk"]);var Tt=r.object({id:r.string().optional(),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Zs,data:V,tags:r.list(r.string()).optional()});var vt=r.object({datasetName:r.property("dataset_name",r.string().optional()),datasetId:r.property("dataset_id",r.string().optional()),items:r.list(Tt),batchGroupId:r.property("batch_group_id",r.string().optional())});var jt=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()),filters:r.string().optional()});var Et=r.object({itemIds:r.property("item_ids",r.list(r.string()).optional()),datasetId:r.property("dataset_id",r.string().optional()),filters:r.list(St).optional(),batchGroupId:r.property("batch_group_id",r.string().optional())});var ma=r.enum_(["private","public"]);var Ct=r.object({name:r.string(),description:r.string().optional(),visibility:ma.optional(),tags:r.list(r.string()).optional()});var It=r.object({versionRef:r.property("version_ref",r.string())});var Dt=r.object({versionName:r.property("version_name",r.string())});var Ut=r.object({tag:r.string()});var Ft=r.object({changeDescription:r.property("change_description",r.string().optional()),tagsToAdd:r.property("tags_to_add",r.list(r.string()).optional())});var da=r.enum_(["private","public"]);var Nt=r.object({id:r.string().optional(),name:r.string(),visibility:da.optional(),tags:r.list(r.string()).optional(),description:r.string().optional()});var Dr={};W(Dr,{CreateDatasetItemsFromSpansRequest:()=>wt,CreateDatasetItemsFromTracesRequest:()=>_t,DatasetExpansionWrite:()=>zt,DatasetIdentifier:()=>kt,DatasetIdentifierPublic:()=>Pt,DatasetItemBatchUpdate:()=>At,DatasetItemBatchWrite:()=>vt,DatasetItemStreamRequest:()=>jt,DatasetItemsDelete:()=>Et,DatasetUpdate:()=>Ct,DatasetUpdateVisibility:()=>ma,DatasetVersionRestorePublic:()=>It,DatasetVersionRetrieveRequestPublic:()=>Dt,DatasetVersionTag:()=>Ut,DatasetVersionUpdatePublic:()=>Ft,DatasetWrite:()=>Nt,DatasetWriteVisibility:()=>da,getDatasetExportJobs:()=>ua});var ua={};W(ua,{Response:()=>KR});var Os=r.enum_(["PENDING","PROCESSING","COMPLETED","FAILED"]);var Ir=r.object({id:r.string().optional(),datasetId:r.property("dataset_id",r.string().optional()),datasetName:r.property("dataset_name",r.string().optional()),status:Os.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 KR=r.list(Ir);var Mt=r.object({name:r.string(),value:r.number()});var qs=r.enum_(["running","completed","cancelled"]);var ep=r.enum_(["regular","trial","mini-batch"]);var Wt=r.object({name:r.string().optional(),metadata:V.optional(),tags:r.list(r.string()).optional(),type:ep.optional(),status:qs.optional(),experimentScores:r.property("experiment_scores",r.list(Mt).optional())});var Bt=r.object({ids:r.list(r.string()),update:Wt,mergeTags:r.property("merge_tags",r.boolean().optional())});var rp=r.enum_(["ui","sdk","online_scoring"]);var tp=r.enum_(["ui","sdk","online_scoring"]);var op=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:tp.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 ip=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:rp,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(),op).optional())});var Ae=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Vt=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var ap=r.enum_(["general","tool","llm","guardrail"]);var np=r.object({id:r.string().optional(),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:ap.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",Vt.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 sp=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",Vt.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),threadId:r.property("thread_id",r.string().optional())});var pp=r.object({datasetItemId:r.property("dataset_item_id",r.string()),evaluateTaskResult:r.property("evaluate_task_result",Ae.optional()),trace:sp.optional(),spans:r.list(np).optional(),feedbackScores:r.property("feedback_scores",r.list(ip).optional())});var Lt=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(pp)});var Ht=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 cp=r.enum_(["default","hidden"]);var lp=r.enum_(["ui","sdk","online_scoring"]);var mp=r.enum_(["ui","sdk","online_scoring"]);var dp=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:mp.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 pe=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:lp,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(),dp).optional())});var K=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Jt=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(pe).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",cp.optional())});var Gt=r.object({experimentItems:r.property("experiment_items",r.list(Jt))});var Kt=r.object({ids:r.list(r.string())});var $t=r.object({name:r.string(),limit:r.number().optional(),lastRetrievedId:r.property("last_retrieved_id",r.string().optional())});var up=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 fa=r.object({id:r.string()});var ha=r.enum_(["running","completed","cancelled"]);var ga=r.enum_(["regular","trial","mini-batch"]);var Qt=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:ga.optional(),optimizationId:r.property("optimization_id",r.string().optional()),status:ha.optional(),experimentScores:r.property("experiment_scores",r.list(up).optional()),promptVersion:r.property("prompt_version",fa.optional()),promptVersions:r.property("prompt_versions",r.list(fa).optional()),datasetVersionId:r.property("dataset_version_id",r.string().optional())});var Ur={};W(Ur,{ExperimentBatchUpdate:()=>Bt,ExperimentItemBulkUploadExperimentItemBulkWriteView:()=>Lt,ExperimentItemStreamRequest:()=>Ht,ExperimentItemsBatch:()=>Gt,ExperimentItemsDelete:()=>Kt,ExperimentStreamRequestPublic:()=>$t,ExperimentWrite:()=>Qt,ExperimentWriteStatus:()=>ha,ExperimentWriteType:()=>ga,findFeedbackScoreNames:()=>ya});var ya={};W(ya,{Response:()=>$R});var $R=r.list(r.string());var Ra={};W(Ra,{FindFeedbackDefinitionsRequestType:()=>ba});var ba=r.enum_(["numerical","categorical","boolean"]);var fp=r.enum_(["TOPIC","PII"]);var hp=r.enum_(["passed","failed"]);var gp=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:fp,result:hp,config:V,details:V});var Yt=r.object({guardrails:r.list(gp)});var xa={};W(xa,{GuardrailBatchWrite:()=>Yt});var Xt=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 wa=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","bedrock","ollama","custom-llm","opik-free"]);var Zt=r.object({provider:wa,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 _a={};W(_a,{ProviderApiKeyUpdate:()=>Xt,ProviderApiKeyWrite:()=>Zt,ProviderApiKeyWriteProvider:()=>wa});var Fr={};W(Fr,{listModels:()=>za});var za={};W(za,{Response:()=>QR});var yp=r.object({name:r.string(),size:r.number().optional(),digest:r.string().optional(),modifiedAt:r.property("modified_at",r.date().optional())});var QR=r.list(yp);var ka=r.enum_(["running","completed","cancelled","initialized","error"]);var Ot=r.object({name:r.string().optional(),status:ka.optional()});var Pa={};W(Pa,{OptimizationUpdate:()=>Ot,OptimizationUpdateStatus:()=>ka});var bp=r.enum_(["none","tags","metadata","name","error_info","model","provider","type"]);var Rp=r.object({field:bp.optional(),metadataKey:r.property("metadata_key",r.string().optional()),subMetric:r.property("sub_metric",r.string().optional())});var xp=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Ue=r.object({field:r.string().optional(),operator:xp.optional(),key:r.string().optional(),value:r.string().optional()});var wp=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Fe=r.object({field:r.string().optional(),operator:wp.optional(),key:r.string().optional(),value:r.string().optional()});var _p=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var ar=r.object({field:r.string().optional(),operator:_p.optional(),key:r.string().optional(),value:r.string().optional()});var Sa=r.enum_(["HOURLY","DAILY","WEEKLY"]);var Aa=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",Aa.optional()),interval:Sa.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(ar).optional()),breakdown:Rp.optional()});var eo=r.object({name:r.string()});var Ta=r.enum_(["private","public"]);var ro=r.object({name:r.string().optional(),description:r.string().optional(),visibility:Ta.optional()});var va=r.enum_(["private","public"]);var to=r.object({name:r.string(),visibility:va.optional(),description:r.string().optional()});var ja={};W(ja,{ProjectMetricRequestPublic:()=>qt,ProjectMetricRequestPublicInterval:()=>Sa,ProjectMetricRequestPublicMetricType:()=>Aa,ProjectRetrieveDetailed:()=>eo,ProjectUpdate:()=>ro,ProjectUpdateVisibility:()=>Ta,ProjectWrite:()=>to,ProjectWriteVisibility:()=>va});var zp=r.record(r.string(),r.unknown());var kp=r.enum_(["text","chat"]);var Pp=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:zp.optional(),type:Pp.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",kp.optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Ea=r.enum_(["text","chat"]);var oo=r.object({name:r.string(),version:Ee,templateStructure:r.property("template_structure",Ea.optional())});var io=r.object({name:r.string(),description:r.string().optional(),tags:r.list(r.string()).optional()});var Sp=r.object({tags:r.list(r.string()).optional()});var ao=r.object({ids:r.list(r.string()),update:Sp,mergeTags:r.property("merge_tags",r.boolean().optional())});var no=r.object({name:r.string(),commit:r.string().optional()});var Ca=r.enum_(["text","chat"]);var Ia=r.enum_(["mustache","jinja2"]);var so=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:Ia.optional(),templateStructure:r.property("template_structure",Ca.optional()),tags:r.list(r.string()).optional()});var Da={};W(Da,{CreatePromptVersionDetail:()=>oo,CreatePromptVersionDetailTemplateStructure:()=>Ea,PromptUpdatable:()=>io,PromptVersionBatchUpdate:()=>ao,PromptVersionRetrieveDetail:()=>no,PromptWrite:()=>so,PromptWriteTemplateStructure:()=>Ca,PromptWriteType:()=>Ia});var Ne=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var Ap=r.enum_(["general","tool","llm","guardrail"]);var po=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:Ap.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 co=r.object({ids:r.list(r.string()),update:po,mergeTags:r.property("merge_tags",r.boolean().optional())});var lo=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var Tp=r.enum_(["general","tool","llm","guardrail"]);var mo=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:Tp.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",lo.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 uo=r.object({spans:r.list(mo)});var Ua=r.enum_(["general","tool","llm","guardrail"]);var fo=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:Ua.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 Nr={};W(Nr,{FindFeedbackScoreNames1RequestType:()=>Na,GetSpanStatsRequestType:()=>Ma,GetSpansByProjectRequestType:()=>Wa,SpanBatchUpdate:()=>co,SpanBatchWrite:()=>uo,SpanSearchStreamRequestPublic:()=>fo,SpanSearchStreamRequestPublicType:()=>Ua,findFeedbackScoreNames1:()=>Fa});var Fa={};W(Fa,{Response:()=>YR});var YR=r.list(r.string());var Na=r.enum_(["general","tool","llm","guardrail"]);var Ma=r.enum_(["general","tool","llm","guardrail"]);var Wa=r.enum_(["general","tool","llm","guardrail"]);var ho=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 go=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 vp=r.enum_(["ui","sdk","online_scoring"]);var jp=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:vp,author:r.string().optional(),threadId:r.property("thread_id",r.string())});var yo=r.object({scores:r.list(jp)});var bo=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 Ro=r.object({ids:r.list(r.string()),update:bo,mergeTags:r.property("merge_tags",r.boolean().optional())});var xo=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",lo.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),threadId:r.property("thread_id",r.string().optional())});var wo=r.object({traces:r.list(xo)});var _o=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 zo=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 ko=r.object({tags:r.list(r.string()).optional()});var Po=r.object({ids:r.list(r.string()),update:ko,mergeTags:r.property("merge_tags",r.boolean().optional())});var Ep=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Te=r.object({field:r.string().optional(),operator:Ep.optional(),key:r.string().optional(),value:r.string().optional()});var So=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 nr={};W(nr,{DeleteThreadFeedbackScores:()=>ho,DeleteTraceThreads:()=>go,FeedbackScoreBatchThread:()=>yo,TraceBatchUpdate:()=>Ro,TraceBatchWrite:()=>wo,TraceSearchStreamRequestPublic:()=>_o,TraceThreadBatchIdentifier:()=>zo,TraceThreadBatchUpdate:()=>Po,TraceThreadSearchStreamRequest:()=>So,findFeedbackScoreNames2:()=>Ba,findTraceThreadsFeedbackScoreNames:()=>Va});var Ba={};W(Ba,{Response:()=>XR});var XR=r.list(r.string());var Va={};W(Va,{Response:()=>ZR});var ZR=r.list(r.string());var Ao=r.object({role:r.string().optional(),integrations:r.list(r.string()).optional(),email:r.string().optional(),joinBetaProgram:r.property("join_beta_program",r.boolean().optional())});var La={};W(La,{WelcomeWizardSubmission:()=>Ao});var de=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 Cp=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(de).optional()),experimentScores:r.property("experiment_scores",r.list(de).optional())});var Ip=r.enum_(["general","slack","pagerduty"]);var Dp=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var Up=r.object({id:r.string().optional(),alertTriggerId:r.property("alert_trigger_id",r.string().optional()),type:Dp,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 Fp=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 Np=r.object({id:r.string().optional(),alertId:r.property("alert_id",r.string().optional()),eventType:r.property("event_type",Fp),triggerConfigs:r.property("trigger_configs",r.list(Up).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Mp=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 OR=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",Ip.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:Mp,triggers:r.list(Np).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 Wp=r.enum_(["general","slack","pagerduty"]);var Bp=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var Vp=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 Lp=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 Hp=r.object({id:r.string().optional(),alertId:r.property("alert_id",r.string().optional()),eventType:r.property("event_type",Lp),triggerConfigs:r.property("trigger_configs",r.list(Vp).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 To=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",Wp.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:Jp,triggers:r.list(Hp).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Gp=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(To).optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var Kp=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var $p=r.object({id:r.string().optional(),type:Kp,configValue:r.property("config_value",r.record(r.string(),r.string()).optional())});var Qp=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 Yp=r.object({id:r.string().optional(),eventType:r.property("event_type",Qp),triggerConfigs:r.property("trigger_configs",r.list($p).optional())});var Xp=r.enum_(["general","slack","pagerduty"]);var Zp=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 vo=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:Zp,triggers:r.list(Yp).optional()});var Op=r.object({username:r.string().optional(),status:r.number().optional()});var qp=r.enum_(["trace","thread"]);var ec=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:qp,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional()),reviewers:r.list(Op).optional(),feedbackScores:r.property("feedback_scores",r.list(de).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 qR=r.object({annotationQueues:r.property("annotation_queues",r.list(ec))});var Ha=r.object({ids:r.list(r.string())});var rc=r.enum_(["trace","thread"]);var tc=r.object({username:r.string().optional(),status:r.number().optional()});var sr=r.object({name:r.string(),value:r.number()});var jo=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:rc,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional()),reviewers:r.list(tc).optional(),feedbackScores:r.property("feedback_scores",r.list(sr).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 oc=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(jo).optional(),sortableBy:r.list(r.string()).optional()});var ic=r.enum_(["system","user","assistant","tool","function"]);var ac=r.enum_(["function"]);var Eo=r.object({id:r.string().optional(),index:r.number().optional(),type:ac.optional(),function:De.optional()});var nc=r.object({role:ic.optional(),content:r.string().optional(),reasoningContent:r.property("reasoning_content",r.string().optional()),name:r.string().optional(),toolCalls:r.property("tool_calls",r.list(Eo).optional()),refusal:r.string().optional(),functionCall:r.property("function_call",De.optional())});var sc=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 pc=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(sc).optional(),sortableBy:r.list(r.string()).optional()});var cc=r.object({url:r.string()});var lc=r.object({url:r.string()});var mc=r.object({url:r.string()});var dc=r.record(r.string(),r.unknown());var uc=r.enum_(["evaluator"]);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",cc.optional())});var yc=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var pr=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 cr=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",V.optional())});var bc=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var lr=r.object({name:r.string(),type:bc,description:r.string()});var Co=r.object({model:cr,messages:r.list(pr),variables:r.record(r.string(),r.string()),schema:r.list(lr)});var Rc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var We=r.object({field:r.string().optional(),operator:Rc.optional(),key:r.string().optional(),value:r.string().optional()});var xc=r.object({filters:r.list(We).optional(),code:Co.optional()});var wc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Be=r.object({field:r.string().optional(),operator:wc.optional(),key:r.string().optional(),value:r.string().optional()});var Io=r.object({model:cr,messages:r.list(pr),variables:r.record(r.string(),r.string()),schema:r.list(lr)});var _c=r.object({filters:r.list(Be).optional(),code:Io.optional()});var Do=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var zc=r.object({filters:r.list(Be).optional(),code:Do.optional()});var Uo=r.object({model:cr,messages:r.list(pr),schema:r.list(lr)});var kc=r.object({filters:r.list(Te).optional(),code:Uo.optional()});var Fo=r.object({metric:r.string()});var Pc=r.object({filters:r.list(Te).optional(),code:Fo.optional()});var No=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Sc=r.object({filters:r.list(We).optional(),code:No.optional()});var Ac=r.object({projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string())});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(Ac).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:uc}),ex=r.union("type",{llm_as_judge:xc.extend(Mr),user_defined_metric_python:Sc.extend(Mr),trace_thread_llm_as_judge:kc.extend(Mr),trace_thread_user_defined_metric_python:Pc.extend(Mr),span_llm_as_judge:_c.extend(Mr),span_user_defined_metric_python:zc.extend(Mr)}).transform({transform:s=>s,untransform:s=>s});var Tc=r.object({url:r.string(),detail:r.string().optional()});var vc=r.object({url:r.string()});var jc=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",Tc.optional()),videoUrl:r.property("video_url",vc.optional()),audioUrl:r.property("audio_url",lc.optional())});var Ec=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var mr=r.object({role:Ec,content:r.string().optional(),contentArray:r.property("content_array",r.list(jc).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var dr=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",ce.optional())});var Cc=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var ur=r.object({name:r.string(),type:Cc,description:r.string()});var Ic=r.object({model:dr,messages:r.list(mr),variables:r.record(r.string(),r.string()),schema:r.list(ur)});var Mo=r.object({filters:r.list(Fe).optional(),code:Ic.optional()});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",mc.optional())});var Nc=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var fr=r.object({role:Nc,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 hr=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",he.optional())});var Mc=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var gr=r.object({name:r.string(),type:Mc,description:r.string()});var Wc=r.object({model:hr,messages:r.list(fr),variables:r.record(r.string(),r.string()),schema:r.list(gr)});var Bc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Wo=r.object({field:r.string().optional(),operator:Bc.optional(),key:r.string().optional(),value:r.string().optional()});var Vc=r.object({filters:r.list(Wo).optional(),code:Wc.optional()});var Lc=r.enum_(["evaluator"]);var Hc=r.object({model:dr,messages:r.list(mr),variables:r.record(r.string(),r.string()),schema:r.list(ur)});var Bo=r.object({filters:r.list(Ue).optional(),code:Hc.optional()});var Jc=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Vo=r.object({filters:r.list(Ue).optional(),code:Jc.optional()});var Gc=r.object({model:dr,messages:r.list(mr),schema:r.list(ur)});var Lo=r.object({filters:r.list(ar).optional(),code:Gc.optional()});var Kc=r.object({metric:r.string()});var Ho=r.object({filters:r.list(ar).optional(),code:Kc.optional()});var $c=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Jo=r.object({filters:r.list(Fe).optional(),code:$c.optional()});var Go=r.object({projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string())});var Wr=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(Go).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:Lc}),Qc=r.union("type",{llm_as_judge:Mo.extend(Wr),user_defined_metric_python:Jo.extend(Wr),trace_thread_llm_as_judge:Lo.extend(Wr),trace_thread_user_defined_metric_python:Ho.extend(Wr),span_llm_as_judge:Bo.extend(Wr),span_user_defined_metric_python:Vo.extend(Wr)}).transform({transform:s=>s,untransform:s=>s});var Yc=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Qc).optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var Xc=r.enum_(["evaluator"]);var Br=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(Go).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:Xc}),Zc=r.union("type",{llm_as_judge:Mo.extend(Br),user_defined_metric_python:Jo.extend(Br),trace_thread_llm_as_judge:Lo.extend(Br),trace_thread_user_defined_metric_python:Ho.extend(Br),span_llm_as_judge:Bo.extend(Br),span_user_defined_metric_python:Vo.extend(Br)}).transform({transform:s=>s,untransform:s=>s});var Oc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Ko=r.object({field:r.string().optional(),operator:Oc.optional(),key:r.string().optional(),value:r.string().optional()});var qc=r.object({model:hr,messages:r.list(fr),variables:r.record(r.string(),r.string()),schema:r.list(gr)});var el=r.object({filters:r.list(Ko).optional(),code:qc.optional()});var rl=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var tl=r.object({filters:r.list(Ko).optional(),code:rl.optional()});var ol=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var $o=r.object({field:r.string().optional(),operator:ol.optional(),key:r.string().optional(),value:r.string().optional()});var il=r.object({model:hr,messages:r.list(fr),schema:r.list(gr)});var al=r.object({filters:r.list($o).optional(),code:il.optional()});var nl=r.object({metric:r.string()});var sl=r.object({filters:r.list($o).optional(),code:nl.optional()});var pl=r.enum_(["evaluator"]);var cl=r.object({filters:r.list(We).optional(),code:Co.optional()});var ll=r.object({filters:r.list(Be).optional(),code:Io.optional()});var ml=r.object({filters:r.list(Be).optional(),code:Do.optional()});var dl=r.object({filters:r.list(Te).optional(),code:Uo.optional()});var ul=r.object({filters:r.list(Te).optional(),code:Fo.optional()});var fl=r.object({filters:r.list(We).optional(),code:No.optional()});var Vr=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:pl}),hl=r.union("type",{llm_as_judge:cl.extend(Vr),user_defined_metric_python:fl.extend(Vr),trace_thread_llm_as_judge:dl.extend(Vr),trace_thread_user_defined_metric_python:ul.extend(Vr),span_llm_as_judge:ll.extend(Vr),span_user_defined_metric_python:ml.extend(Vr)}).transform({transform:s=>s,untransform:s=>s});var gl=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var yl=r.object({filters:r.list(Wo).optional(),code:gl.optional()});var bl=r.enum_(["evaluator"]);var Lr=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:bl}),Rl=r.union("type",{llm_as_judge:Vc.extend(Lr),user_defined_metric_python:yl.extend(Lr),trace_thread_llm_as_judge:al.extend(Lr),trace_thread_user_defined_metric_python:sl.extend(Lr),span_llm_as_judge:el.extend(Lr),span_user_defined_metric_python:tl.extend(Lr)}).transform({transform:s=>s,untransform:s=>s});var xl=r.object({value:r.number().optional()});var X=r.object({ids:r.list(r.string())});var rx=r.object({ids:r.list(r.string()),projectId:r.property("project_id",r.string().optional())});var wl=r.object({workspaceId:r.property("workspace_id",r.string().optional()),user:r.string().optional(),count:r.number().optional()});var Hr=r.object({biInformation:r.property("bi_information",r.list(wl).optional())});var _l=r.object({trueLabel:r.string(),falseLabel:r.string()});var zl=r.object({details:_l.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 kl=r.object({trueLabel:r.string(),falseLabel:r.string()});var Pl=r.object({details:kl.optional()});var Sl=r.object({trueLabel:r.string(),falseLabel:r.string()});var Qo=r.object({details:Sl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Al=r.object({trueLabel:r.string(),falseLabel:r.string()});var Tl=r.object({details:Al.optional()});var vl=r.object({categories:r.record(r.string(),r.number())});var jl=r.object({details:vl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var El=r.object({categories:r.record(r.string(),r.number())});var Cl=r.object({details:El.optional()});var Il=r.object({categories:r.record(r.string(),r.number())});var Yo=r.object({details:Il.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 Dl=r.object({categories:r.record(r.string(),r.number())});var Ul=r.object({details:Dl.optional()});var Fl=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(Eo).optional()),functionCall:r.property("function_call",De.optional())});var Nl=r.object({index:r.number().optional(),message:nc.optional(),delta:Fl.optional(),finishReason:r.property("finish_reason",r.string().optional())});var Ml=r.object({reasoningTokens:r.property("reasoning_tokens",r.number().optional())});var Wl=r.object({cachedTokens:r.property("cached_tokens",r.number().optional())});var Bl=r.object({totalTokens:r.property("total_tokens",r.number().optional()),promptTokens:r.property("prompt_tokens",r.number().optional()),promptTokensDetails:r.property("prompt_tokens_details",Wl.optional()),completionTokens:r.property("completion_tokens",r.number().optional()),completionTokensDetails:r.property("completion_tokens_details",Ml.optional())});var Vl=r.object({id:r.string().optional(),created:r.number().optional(),model:r.string().optional(),choices:r.list(Nl).optional(),usage:Bl.optional(),systemFingerprint:r.property("system_fingerprint",r.string().optional()),serviceTier:r.property("service_tier",r.string().optional())});var Ll=r.enum_(["TOPIC","PII"]);var Hl=r.enum_(["passed","failed"]);var Jl=r.object({name:Ll.optional(),result:Hl.optional()});var Gl=r.enum_(["TOPIC","PII"]);var Kl=r.enum_(["passed","failed"]);var $l=r.object({name:Gl.optional(),result:Kl.optional()});var Ql=r.object({typeName:r.string().optional()});var tx=r.object({type:Ql.optional(),closed:r.boolean().optional()});var Yl=r.object({typeName:r.string().optional()});var ox=r.object({type:Yl.optional(),closed:r.boolean().optional()});var Xl=r.enum_(["string","number","object","boolean","array","null"]);var Zl=r.object({name:r.string().optional(),types:r.list(Xl).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var Ol=r.enum_(["string","number","object","boolean","array","null"]);var ql=r.object({name:r.string().optional(),types:r.list(Ol).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var em=r.enum_(["string","number","object","boolean","array","null"]);var rm=r.object({name:r.string().optional(),types:r.list(em).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var tm=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 yr=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 om=r.enum_(["trace","span"]);var im=r.object({eTag:r.property("e_tag",r.string()),partNumber:r.property("part_number",r.number())});var Ja=r.object({fileName:r.property("file_name",r.string()),projectName:r.property("project_name",r.string().optional()),entityType:r.property("entity_type",om),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(im))});var am=r.object({value:r.number().optional()});var br=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:ce,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 nm=r.object({content:r.list(br).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var ix=r.object({time:r.date(),value:r.number().optional()});var sm=r.object({time:r.date(),value:r.number().optional()});var pm=r.enum_(["unknown","processing","completed","failed"]);var Xo=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 cm=r.enum_(["private","public"]);var ax=r.object({id:r.string().optional(),name:r.string(),visibility:cm.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:pm.optional(),latestVersion:r.property("latest_version",Xo.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 lm=r.enum_(["manual","trace","span","sdk"]);var Zo=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:lm,data:V,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Jt).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 mm=r.object({generatedSamples:r.property("generated_samples",r.list(Zo).optional()),model:r.string().optional(),totalGenerated:r.property("total_generated",r.number().optional()),generationTime:r.property("generation_time",r.date().optional())});var sx=r.object({datasetName:r.property("dataset_name",r.string().optional()),datasetId:r.property("dataset_id",r.string().optional()),items:r.list(Zo),batchGroupId:r.property("batch_group_id",r.string().optional())});var dm=r.record(r.string(),r.unknown());var um=r.enum_(["manual","trace","span","sdk"]);var fm=r.enum_(["default","hidden"]);var hm=r.enum_(["ui","sdk","online_scoring"]);var gm=r.enum_(["ui","sdk","online_scoring"]);var ym=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:gm.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 bm=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:hm,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(),ym).optional())});var Ga=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Rm=r.object({id:r.string().optional(),experimentId:r.property("experiment_id",r.string()),datasetItemId:r.property("dataset_item_id",r.string()),traceId:r.property("trace_id",r.string()),input:Ga.optional(),output:Ga.optional(),feedbackScores:r.property("feedback_scores",r.list(bm).optional()),comments:r.list(tm).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",fm.optional())});var xm=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:um,data:V,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Rm).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 wm=r.object({content:r.list(xm).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),columns:r.list(ql).optional(),sortableBy:r.list(r.string()).optional()});var _m=r.enum_(["manual","trace","span","sdk"]);var zm=r.enum_(["default","hidden"]);var Oo=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",zm.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:_m,data:V,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Oo).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 km=r.object({content:r.list(qo).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),columns:r.list(rm).optional(),sortableBy:r.list(r.string()).optional()});var Pm=r.enum_(["unknown","processing","completed","failed"]);var Sm=r.enum_(["private","public"]);var ei=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 Jr=r.object({id:r.string().optional(),name:r.string(),visibility:Sm.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:Pm.optional(),latestVersion:r.property("latest_version",ei.optional())});var Am=r.object({content:r.list(Jr).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),sortableBy:r.list(r.string()).optional()});var Tm=r.object({itemsAdded:r.number().optional(),itemsModified:r.number().optional(),itemsDeleted:r.number().optional(),itemsUnchanged:r.number().optional()});var vm=r.object({fromVersion:r.property("from_version",r.string().optional()),toVersion:r.property("to_version",r.string().optional()),statistics:Tm.optional()});var Je=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 jm=r.object({content:r.list(Je).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional()});var Em=r.enum_(["trace","span"]);var px=r.object({fileNames:r.property("file_names",r.list(r.string())),entityType:r.property("entity_type",Em),entityId:r.property("entity_id",r.string()),containerId:r.property("container_id",r.string())});var ri=r.object({name:r.string(),author:r.string().optional()});var Gr=r.object({ids:r.list(r.string())});var ti=r.object({count:r.number().optional(),deviation:r.number().optional(),deviationPercentage:r.property("deviation_percentage",r.number().optional())});var Cm=r.object({count:r.number().optional(),deviation:r.number().optional(),deviationPercentage:r.property("deviation_percentage",r.number().optional())});var oi=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var ae=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var cx=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 mx=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var Im=r.enum_(["running","completed","cancelled"]);var Dm=r.enum_(["regular","trial","mini-batch"]);var Ka=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 dx=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()),projectName:r.property("project_name",r.string().optional()),name:r.string().optional(),metadata:K.optional(),tags:r.list(r.string()).optional(),type:Dm.optional(),optimizationId:r.property("optimization_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(de).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:Im.optional(),experimentScores:r.property("experiment_scores",r.list(Mt).optional()),promptVersion:r.property("prompt_version",Ka.optional()),promptVersions:r.property("prompt_versions",r.list(Ka).optional()),datasetVersionId:r.property("dataset_version_id",r.string().optional()),datasetVersionSummary:r.property("dataset_version_summary",Xo.optional())});var Um=r.object({label:r.string().optional(),aggregations:Cp.optional()});var Fm=r.object({content:r.record(r.string(),Um).optional()});var Nm=r.object({label:r.string().optional()});var Mm=r.object({groupSorting:r.property("group_sorting",r.list(r.string()).optional())});var Wm=r.object({groupsDetails:r.property("groups_details",r.list(Mm).optional())});var Bm=r.object({content:r.record(r.string(),Nm).optional(),details:Wm.optional()});var Vm=r.enum_(["general","tool","llm","guardrail"]);var ii=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:Vm.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(pe).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 Lm=r.object({id:r.string(),name:r.string(),datasetId:r.property("dataset_id",r.string()),datasetItemId:r.property("dataset_item_id",r.string())});var Hm=r.object({spanId:r.property("span_id",r.string().optional()),checks:r.list(Jl).optional()});var Jm=r.enum_(["default","hidden"]);var ai=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(pe).optional()),spanFeedbackScores:r.property("span_feedback_scores",r.list(pe).optional()),comments:r.list(O).optional(),guardrailsValidations:r.property("guardrails_validations",r.list(Hm).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",Jm.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(),experiment:Lm.optional()});var Gm=r.object({datasetItemId:r.property("dataset_item_id",r.string()),evaluateTaskResult:r.property("evaluate_task_result",K.optional()),trace:ai.optional(),spans:r.list(ii).optional(),feedbackScores:r.property("feedback_scores",r.list(pe).optional())});var ux=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(Gm)});var Km=r.object({id:r.string(),name:r.string(),datasetId:r.property("dataset_id",r.string()),datasetItemId:r.property("dataset_item_id",r.string())});var $m=r.enum_(["running","completed","cancelled"]);var Qm=r.enum_(["regular","trial","mini-batch"]);var Ym=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 ni=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var $a=r.object({id:r.string(),commit:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),promptName:r.property("prompt_name",r.string().optional())});var si=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()),projectName:r.property("project_name",r.string().optional()),name:r.string().optional(),metadata:ye.optional(),tags:r.list(r.string()).optional(),type:Qm.optional(),optimizationId:r.property("optimization_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(sr).optional()),comments:r.list(yr).optional(),traceCount:r.property("trace_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),duration:ni.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:$m.optional(),experimentScores:r.property("experiment_scores",r.list(Ym).optional()),promptVersion:r.property("prompt_version",$a.optional()),promptVersions:r.property("prompt_versions",r.list($a).optional()),datasetVersionId:r.property("dataset_version_id",r.string().optional()),datasetVersionSummary:r.property("dataset_version_summary",ei.optional())});var Xm=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 fx=V;var Zm=r.object({max:r.number(),min:r.number()});var Om=r.object({details:Zm.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 qm=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()}),hx=r.union("type",{numerical:Om.extend(qm),categorical:jl.extend(qm),boolean:zl.extend(qm)}).transform({transform:s=>s,untransform:s=>s});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:Cl.extend(td),boolean:Pl.extend(td)}).transform({transform:s=>s,untransform:s=>s});var id=r.object({max:r.number(),min:r.number()});var pi=r.object({details:id.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 ad=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()}),nd=r.union("type",{numerical:pi.extend(ad),categorical:Yo.extend(ad),boolean:Qo.extend(ad)}).transform({transform:s=>s,untransform:s=>s});var sd=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(nd).optional()});var pd=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()}),cd=r.union("type",{numerical:pi.extend(pd),categorical:Yo.extend(pd),boolean:Qo.extend(pd)}).transform({transform:s=>s,untransform:s=>s});var ld=r.object({name:r.string(),value:r.number()});var md=r.enum_(["ui","sdk","online_scoring"]);var dd=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:md,author:r.string().optional(),id:r.string()});var ci=r.object({scores:r.list(dd)});var ud=r.object({name:r.string().optional(),type:r.string().optional()});var fd=r.object({scores:r.list(ud).optional()});var hd=r.enum_(["ui","sdk","online_scoring"]);var gd=r.enum_(["ui","sdk","online_scoring"]);var yd=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:gd.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 Kr=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:hd,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(),yd).optional())});var bd=r.object({max:r.number(),min:r.number()});var Rd=r.object({details:bd.optional()});var xd=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional()}),wd=r.union("type",{numerical:Rd.extend(xd),categorical:Ul.extend(xd),boolean:Tl.extend(xd)}).transform({transform:s=>s,untransform:s=>s});var _d=r.enum_(["TOPIC","PII"]);var zd=r.enum_(["passed","failed"]);var kd=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:_d,result:zd,config:V,details:V});var gx=r.object({guardrails:r.list(kd)});var Pd=r.object({spanId:r.property("span_id",r.string().optional()),checks:r.list($l).optional()});var yx=r.object({ids:r.list(r.string())});var Sd=r.enum_(["INFO","WARN","ERROR","DEBUG","TRACE"]);var Ad=r.object({timestamp:r.date().optional(),ruleId:r.property("rule_id",r.string().optional()),level:Sd.optional(),message:r.string().optional(),markers:r.record(r.string(),r.string()).optional()});var Td=r.object({content:r.list(Ad).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional()});var vd=r.enum_(["trace","thread","span"]);var li=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",vd)});var mi=r.object({entitiesQueued:r.property("entities_queued",r.number().optional()),rulesApplied:r.property("rules_applied",r.number().optional())});var Qa=r.object({connected:r.boolean().optional(),version:r.string().optional(),errorMessage:r.property("error_message",r.string().optional())});var Ya=r.object({baseUrl:r.property("base_url",r.string()),apiKey:r.property("api_key",r.string().optional())});var jd=r.enum_(["running","completed","cancelled","initialized","error"]);var Ed=r.object({type:r.string(),parameters:V.optional()});var Cd=r.object({metrics:r.list(Ed)});var Id=r.object({model:r.string(),parameters:V.optional()});var Dd=r.object({type:r.string(),parameters:V.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 bx=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:jd,metadata:K.optional(),studioConfig:r.property("studio_config",Nd.optional()),datasetId:r.property("dataset_id",r.string().optional()),numTrials:r.property("num_trials",r.number().optional()),feedbackScores:r.property("feedback_scores",r.list(de).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 Md=r.enum_(["running","completed","cancelled","initialized","error"]);var Wd=r.object({type:r.string(),parameters:ce.optional()});var Bd=r.object({metrics:r.list(Wd)});var Vd=r.object({model:r.string(),parameters:ce.optional()});var Ld=r.object({type:r.string(),parameters:ce.optional()});var Hd=r.object({role:r.string(),content:r.string()});var Jd=r.object({messages:r.list(Hd)});var Gd=r.object({datasetName:r.property("dataset_name",r.string()),prompt:Jd,llmModel:r.property("llm_model",Vd),evaluation:Bd,optimizer:Ld});var di=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:Md,metadata:ye.optional(),studioConfig:r.property("studio_config",Gd.optional()),datasetId:r.property("dataset_id",r.string().optional()),numTrials:r.property("num_trials",r.number().optional()),feedbackScores:r.property("feedback_scores",r.list(sr).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 Kd=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 $d=r.object({type:r.string(),parameters:he.optional()});var Qd=r.object({metrics:r.list($d)});var Yd=r.object({model:r.string(),parameters:he.optional()});var Xd=r.object({type:r.string(),parameters:he.optional()});var Zd=r.object({role:r.string(),content:r.string()});var Od=r.object({messages:r.list(Zd)});var qd=r.object({datasetName:r.property("dataset_name",r.string()),prompt:Od,llmModel:r.property("llm_model",Yd),evaluation:Qd,optimizer:Xd});var eu=r.object({url:r.string().optional(),lastModified:r.property("last_modified",r.date().optional()),expiresAt:r.property("expires_at",r.date().optional())});var ru=r.enum_(["running","completed","cancelled","initialized","error"]);var Xa=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:ru,metadata:ge.optional(),studioConfig:r.property("studio_config",qd.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var tu=r.object({columns:r.list(Zl).optional()});var ou=r.object({value:ni.optional()});var iu=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var au=r.enum_(["private","public"]);var Rx=r.object({id:r.string().optional(),name:r.string(),visibility:au.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(de).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",ti.optional())});var nu=r.enum_(["private","public"]);var su=r.object({id:r.string().optional(),name:r.string(),visibility:nu.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(ld).optional()),duration:iu.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",Cm.optional())});var pu=r.enum_(["HOURLY","DAILY","WEEKLY"]);var cu=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 lu=r.object({name:r.string().optional(),data:r.list(sm).optional()});var mu=r.object({projectId:r.property("project_id",r.string().optional()),metricType:r.property("metric_type",cu.optional()),interval:pu.optional(),results:r.list(lu).optional()});var du=r.enum_(["private","public"]);var ui=r.object({id:r.string().optional(),name:r.string(),visibility:du.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 uu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ui).optional(),sortableBy:r.list(r.string()).optional()});var fu=r.object({name:r.string().optional()}),hu=r.union("type",{PERCENTAGE:ou.extend(fu),COUNT:am.extend(fu),AVG:xl.extend(fu)}).transform({transform:s=>s,untransform:s=>s});var Ge=r.object({stats:r.list(hu).optional()});var gu=r.object({projectId:r.property("project_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(de).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",ti.optional())});var yu=r.object({content:r.list(gu).optional()});var bu=r.enum_(["text","chat"]);var Ru=r.enum_(["mustache","jinja2"]);var xu=r.enum_(["text","chat"]);var wu=r.enum_(["mustache","jinja2"]);var _u=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:V.optional(),type:wu.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",xu.optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var xx=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),template:r.string().optional(),metadata:V.optional(),changeDescription:r.property("change_description",r.string().optional()),type:Ru.optional(),templateStructure:r.property("template_structure",bu.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",_u.optional())});var zu=r.enum_(["text","chat"]);var ku=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),templateStructure:r.property("template_structure",zu.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 Pu=r.enum_(["text","chat"]);var Su=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),templateStructure:r.property("template_structure",Pu.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 Au=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Su).optional(),sortableBy:r.list(r.string()).optional()});var Tu=r.enum_(["text","chat"]);var vu=r.enum_(["mustache","jinja2"]);var ju=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:ce.optional(),type:vu.optional(),changeDescription:r.property("change_description",r.string().optional()),tags: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 Eu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ju).optional(),sortableBy:r.list(r.string()).optional()});var Cu=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","bedrock","ollama","custom-llm","opik-free"]);var wx=r.object({id:r.string().optional(),provider:Cu,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 Iu=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","bedrock","ollama","custom-llm","opik-free"]);var fi=r.object({id:r.string().optional(),provider:Iu,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 Du=r.object({size:r.number().optional(),total:r.number().optional(),content:r.list(fi).optional(),sortableBy:r.list(r.string()).optional()});var Rr=r.object({name:r.string().optional(),current:r.number().optional(),previous:r.number().optional()});var Uu=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(),ollamaProviderEnabled:r.boolean(),collaboratorsTabEnabled:r.boolean()});var _x=r.object({spans:r.list(ii)});var Fu=r.enum_(["general","tool","llm","guardrail"]);var hi=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:Fu.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",oi.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(Kr).optional()),comments:r.list(yr).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 Nu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(hi).optional(),sortableBy:r.list(r.string()).optional()});var Mu=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(Mu).optional())});var Bu=r.object({uploadId:r.property("upload_id",r.string()),preSignUrls:r.property("pre_sign_urls",r.list(r.string()))});var Vu=r.object({names:r.list(r.string()).optional()});var zx=r.object({traces:r.list(ai)});var Lu=r.object({workspace:r.string().optional(),traceCount:r.property("trace_count",r.number().optional())});var Hu=r.object({workspacesTracesCount:r.property("workspaces_traces_count",r.list(Lu).optional())});var Ju=r.enum_(["default","hidden"]);var gi=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",oi.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(Kr).optional()),spanFeedbackScores:r.property("span_feedback_scores",r.list(Kr).optional()),comments:r.list(yr).optional(),guardrailsValidations:r.property("guardrails_validations",r.list(Pd).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",Ju.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(),experiment:Km.optional()});var Gu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(gi).optional(),sortableBy:r.list(r.string()).optional()});var Ku=r.enum_(["active","inactive"]);var yi=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(pe).optional()),status:Ku.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 Za=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 $u=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(yi).optional(),sortableBy:r.list(r.string()).optional()});var Qu=r.object({responseExamples:r.property("response_examples",r.record(r.string(),r.record(r.string(),r.unknown())).optional())});var Yu=r.enum_(["success","failure"]);var Xu=r.object({status:Yu.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 Zu=r.object({completed:r.boolean().optional()});var bi=r.object({timeoutToMarkThreadAsInactive:r.property("timeout_to_mark_thread_as_inactive",r.string().optional()),truncationOnTables:r.property("truncation_on_tables",r.boolean().optional())});var kx=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 Oa=r.object({results:r.list(Rr).optional()});var $r=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 Ou=r.object({results:r.list(Rr).optional()});var qu=r.object({workspaceName:r.property("workspace_name",r.string().optional())});var qa=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,R,T,v,E,C;let{page:t,size:i,sorting:a,filters:n}=o,p={page:t,size:i,sorting:a,filters:n},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/private/alerts"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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:Gp.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/alerts"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:vo.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 Q(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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/alerts/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/alerts/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:To.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/alerts/${x.encodePathParam(o)}`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:vo.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new D(n.error.body,n.rawResponse);case 409:throw new $(n.error.body,n.rawResponse);case 422:throw new Q(n.error.body,n.rawResponse);default:throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return A(n.error,n.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,R,T;let{alertType:t}=o,i={alert_type:t!=null?ra.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0},a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.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:(R=e==null?void 0:e.maxRetries)!=null?R:(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(n.ok)return {data:Qu.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"GET","/v1/private/alerts/webhooks/examples")}testWebhook(o,e){return _.fromPromise(this.__testWebhook(o,e))}async __testWebhook(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/alerts/webhooks/tests"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:vo.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:Xu.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 Q(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 en=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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/annotation-queues/${x.encodePathParam(o)}/items/add`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Ha.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v,E,C,U;let{page:t,size:i,name:a,filters:n,sorting:p}=o,l={page:t,size:i,name:a,filters:n,sorting:p},c=z((m=this._options)==null?void 0:m.headers,S({"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:x.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:P.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:(R=this._options)==null?void 0:R.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:oc.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/annotation-queues"),method:"POST",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 422:throw new Q(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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/annotation-queues/batch"),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: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 Q(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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/annotation-queues/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/annotation-queues/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:jo.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/annotation-queues/${x.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:(R=this._options)==null?void 0:R.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/annotation-queues/${x.encodePathParam(o)}/items/delete`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Ha.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"POST","/v1/private/annotation-queues/{id}/items/delete")}};var rn=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,R,T,v,E,C,U,M;let{page:t,size:i,projectId:a,entityType:n,entityId:p,path:l}=o,c={page:t,size:i,project_id:a,entity_type:na.jsonOrThrow(n,{unrecognizedObjectKeys:"strip",omitUndefined:true}),entity_id:p,path:l},d=z((f=this._options)==null?void 0:f.headers,S({"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:x.join((R=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?R:P.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:pc.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 se(ae.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/attachment/upload-complete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ja.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 se(ae.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/attachment/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ja.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 se(ae.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,R,T,v,E,C,U,M;let{workspaceName:t,containerId:i,entityType:a,entityId:n,fileName:p,mimeType:l}=o,c={workspace_name:t,container_id:i,entity_type:sa.jsonOrThrow(a,{unrecognizedObjectKeys:"strip",omitUndefined:true}),entity_id:n,file_name:p,mime_type:l},d=z((f=this._options)==null?void 0:f.headers,S({"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:x.join((R=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?R:P.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 se(ae.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/attachment/upload-start"),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:Bu.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 se(ae.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,R,T,v,E,C,U,M;let{fileName:t,projectName:i,mimeType:a,entityType:n,entityId:p,body:l}=o,c={file_name:t,project_name:i,mime_type:a,entity_type:pa.jsonOrThrow(n,{unrecognizedObjectKeys:"strip",omitUndefined:true}),entity_id:p},d=z((f=this._options)==null?void 0:f.headers,S({"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:x.join((R=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?R:P.Default,"v1/private/attachment/upload"),method:"PUT",headers:d,contentType:"application/json",queryParameters:{...c,...e==null?void 0:e.queryParams},requestType:"json",body:Cr.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 se(ae.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 tn=class{constructor(o={}){this._options=F(o);}findEvaluators(o={},e){return _.fromPromise(this.__findEvaluators(o,e))}async __findEvaluators(o={},e){var u,h,g,R,T,v,E,C,U,M,Z;let{projectId:t,id:i,name:a,filters:n,sorting:p,page:l,size:c}=o,d={project_id:t,id:i,name:a,filters:n,sorting:p,page:l,size:c},m=z((u=this._options)==null?void 0:u.headers,S({"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:x.join((T=(R=await b.get(this._options.baseUrl))!=null?R:await b.get(this._options.environment))!=null?T:P.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:(Z=this._options)==null?void 0:Z.fetch,logging:this._options.logging});if(f.ok)return {data:Yc.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/automations/evaluators"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Rl.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,R,T,v;let{projectId:t,body:i}=o,a={project_id:t},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,"v1/private/automations/evaluators/delete"),method:"POST",headers:n,contentType:"application/json",queryParameters:{...a,...e==null?void 0:e.queryParams},requestType:"json",body:X.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:(R=this._options)==null?void 0:R.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,R,T,v;let{projectId:i}=e,a={project_id:i},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,`v1/private/automations/evaluators/${x.encodePathParam(o)}`),method:"GET",headers:n,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:(R=this._options)==null?void 0:R.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:Zc.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/automations/evaluators/${x.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:hl.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v;let{size:i}=e,a={size:i},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,`v1/private/automations/evaluators/${x.encodePathParam(o)}/logs`),method:"GET",headers:n,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:(R=this._options)==null?void 0:R.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:Td.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 on=class{constructor(o={}){this._options=F(o);}createChatCompletions(o={},e){return _.fromPromise(this.__createChatCompletions(o,e))}async __createChatCompletions(o={},e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/chat/completions"),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:Vl.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 an=class{constructor(o={}){this._options=F(o);}access(o,e){return _.fromPromise(this.__access(o,e))}async __access(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/auth"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:dc.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 se(ae.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:qu.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 se(ae.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 nn=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,R,T,v,E,C;let{page:t,size:i,name:a,sorting:n}=o,p={page:t,size:i,name:a,sorting:n},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/private/dashboards"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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:nm.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/dashboards"),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:br.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/dashboards/${x.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:(R=this._options)==null?void 0:R.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,"GET","/v1/private/dashboards/{dashboardId}")}deleteDashboard(o,e={},t){return _.fromPromise(this.__deleteDashboard(o,e,t))}async __deleteDashboard(o,e={},t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/dashboards/${x.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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/dashboards/${x.encodePathParam(o)}`),method:"PATCH",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Rt.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:(R=this._options)==null?void 0:R.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")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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/dashboards/delete-batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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 sn=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,R,T,v,E;let{override:i,body:a}=e,n={override:i},p=z((c=this._options)==null?void 0:c.headers,S({"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:x.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/items/changes`),method:"POST",headers:p,contentType:"application/json",queryParameters:{...n,...t==null?void 0:t.queryParams},requestType:"json",body:dm.jsonOrThrow(a,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((R=(g=t==null?void 0:t.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?R: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")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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/items/batch"),method:"PATCH",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,"PATCH","/v1/private/datasets/items/batch")}findDatasets(o={},e){return _.fromPromise(this.__findDatasets(o,e))}async __findDatasets(o={},e){var h,g,R,T,v,E,C,U,M,Z,ie;let{page:t,size:i,withExperimentsOnly:a,withOptimizationsOnly:n,promptId:p,name:l,sorting:c,filters:d}=o,m={page:t,size:i,with_experiments_only:a,with_optimizations_only:n,prompt_id:p,name:l,sorting:c,filters:d},f=z((h=this._options)==null?void 0:h.headers,S({"Comet-Workspace":(R=e==null?void 0:e.workspaceName)!=null?R:(g=this._options)==null?void 0:g.workspaceName}),e==null?void 0:e.headers),u=await k({url:x.join((v=(T=await b.get(this._options.baseUrl))!=null?T:await b.get(this._options.environment))!=null?v:P.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:(Z=e==null?void 0:e.maxRetries)!=null?Z:(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: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")}createDataset(o,e){return _.fromPromise(this.__createDataset(o,e))}async __createDataset(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets"),method:"POST",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")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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/items"),method:"PUT",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,"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,R,T;let t=await yh();t.append("file",Pe(o.file)),t.append("dataset_id",o.datasetId);let i=await t.getRequest(),a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.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:(R=e==null?void 0:e.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new D(n.error.body,n.rawResponse);case 404:throw new I(n.error.body,n.rawResponse);default:throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return A(n.error,n.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/items/from-spans`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:wt.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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/items/from-traces`),method:"POST",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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Jr.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.encodePathParam(o)}`),method:"PUT",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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.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:(R=this._options)==null?void 0:R.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/delete"),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")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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/items/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Et.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/delete-batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/export-jobs/${x.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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/expansions`),method:"POST",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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:mm.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,R,T,v,E,C,U,M,Z,ie;let{page:i,size:a,experimentIds:n,filters:p,sorting:l,search:c,truncate:d}=e,m={page:i,size:a,experiment_ids:n,filters:p,sorting:l,search:c,truncate:d},f=z((h=this._options)==null?void 0:h.headers,S({"Comet-Workspace":(R=t==null?void 0:t.workspaceName)!=null?R:(g=this._options)==null?void 0:g.workspaceName}),t==null?void 0:t.headers),u=await k({url:x.join((v=(T=await b.get(this._options.baseUrl))!=null?T:await b.get(this._options.environment))!=null?v:P.Default,`v1/private/datasets/${x.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:(Z=t==null?void 0:t.maxRetries)!=null?Z:(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:wm.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/retrieve"),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:Jr.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,R,T,v,E;let{experimentIds:i,filters:a}=e,n={experiment_ids:i,filters:a},p=z((c=this._options)==null?void 0:c.headers,S({"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:x.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/items/experiments/items/stats`),method:"GET",headers:p,queryParameters:{...n,...t==null?void 0:t.queryParams},timeoutMs:((R=(g=t==null?void 0:t.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?R: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:Ge.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/export-jobs/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Ir.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Dr.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/items/${x.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:(R=this._options)==null?void 0:R.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/datasets/items/${x.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Tt.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v,E,C,U,M;let{page:i,size:a,version:n,filters:p,truncate:l}=e,c={page:i,size:a,version:n,filters:p,truncate:l},d=z((f=this._options)==null?void 0:f.headers,S({"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:x.join((R=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?R:P.Default,`v1/private/datasets/${x.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:km.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,R,T,v;let{experimentIds:i}=e,a={experiment_ids:i},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/items/experiments/items/output/columns`),method:"GET",headers:n,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:(R=this._options)==null?void 0:R.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:tu.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/export-jobs/${x.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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Ir.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/items/stream"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:jt.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:vm.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,R,T;let a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/versions/hash/${x.encodePathParam(e)}/tags`),method:"POST",headers:a,contentType:"application/json",queryParameters:i==null?void 0:i.queryParams,requestType:"json",body:Ut.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:(R=i==null?void 0:i.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new D(n.error.body,n.rawResponse);case 404:throw new I(n.error.body,n.rawResponse);case 409:throw new $(n.error.body,n.rawResponse);default:throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return A(n.error,n.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,R,T,v;let n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/versions/${x.encodePathParam(e)}/tags/${x.encodePathParam(t)}`),method:"DELETE",headers:n,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:(R=this._options)==null?void 0:R.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,R,T,v,E;let{page:i,size:a}=e,n={page:i,size:a},p=z((c=this._options)==null?void 0:c.headers,S({"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:x.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/versions`),method:"GET",headers:p,queryParameters:{...n,...t==null?void 0:t.queryParams},timeoutMs:((R=(g=t==null?void 0:t.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?R: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:jm.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/versions/restore`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:It.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Je.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")}retrieveDatasetVersion(o,e,t){return _.fromPromise(this.__retrieveDatasetVersion(o,e,t))}async __retrieveDatasetVersion(o,e,t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/versions/retrieve`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Dt.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Je.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/datasets/{id}/versions/retrieve")}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,R,T;let a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/versions/hash/${x.encodePathParam(e)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:i==null?void 0:i.queryParams,requestType:"json",body:Ft.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:(R=i==null?void 0:i.maxRetries)!=null?R:(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(n.ok)return {data:Je.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new D(n.error.body,n.rawResponse);case 404:throw new I(n.error.body,n.rawResponse);case 409:throw new $(n.error.body,n.rawResponse);default:throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return A(n.error,n.rawResponse,"PATCH","/v1/private/datasets/{id}/versions/hash/{versionHash}")}};var pn=class{constructor(o={}){this._options=F(o);}batchUpdateExperiments(o,e){return _.fromPromise(this.__batchUpdateExperiments(o,e))}async __batchUpdateExperiments(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/batch"),method:"PATCH",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 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,Z,ie,ze,ke,Ve,tt,ot,gf;let{page:t,size:i,datasetId:a,optimizationId:n,types:p,name:l,datasetDeleted:c,promptId:d,projectId:m,projectDeleted:f,sorting:u,filters:h,experimentIds:g,forceSorting:R}=o,T={page:t,size:i,datasetId:a,optimization_id:n,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:R},v=z((C=this._options)==null?void 0:C.headers,S({"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:x.join((ie=(Z=await b.get(this._options.baseUrl))!=null?Z:await b.get(this._options.environment))!=null?ie:P.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:(ot=e==null?void 0:e.maxRetries)!=null?ot:(tt=this._options)==null?void 0:tt.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(gf=this._options)==null?void 0:gf.fetch,logging:this._options.logging});if(E.ok)return {data:Xm.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments"),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: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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/items"),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: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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/items/delete"),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")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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/delete"),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: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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/items/bulk"),method:"PUT",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 Q(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,R,T;let{experimentIds:t}=o,i={experiment_ids:t},a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.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:(R=e==null?void 0:e.maxRetries)!=null?R:(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(n.ok)return {data:Ur.findFeedbackScoreNames.Response.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v,E,C,U;let{groups:t,types:i,name:a,projectId:n,filters:p}=o,l={groups:t,types:i,name:a,project_id:n,filters:p},c=z((m=this._options)==null?void 0:m.headers,S({"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:x.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:P.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:(R=this._options)==null?void 0:R.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:Bm.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,R,T,v,E,C,U;let{groups:t,types:i,name:a,projectId:n,filters:p}=o,l={groups:t,types:i,name:a,project_id:n,filters:p},c=z((m=this._options)==null?void 0:m.headers,S({"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:x.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:P.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:(R=this._options)==null?void 0:R.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:Fm.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/finish"),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: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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/experiments/${x.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:(R=this._options)==null?void 0:R.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/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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/experiments/${x.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Wt.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new D(n.error.body,n.rawResponse);case 404:throw new I(n.error.body,n.rawResponse);default:throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return A(n.error,n.rawResponse,"PATCH","/v1/private/experiments/{id}")}getExperimentItemById(o,e={},t){return _.fromPromise(this.__getExperimentItemById(o,e,t))}async __getExperimentItemById(o,e={},t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/experiments/items/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Oo.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/items/stream"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ht.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/stream"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:$t.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 cn=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,R,T,v,E,C;let{page:t,size:i,name:a,type:n}=o,p={page:t,size:i,name:a,type:n!=null?ba.jsonOrThrow(n,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/private/feedback-definitions"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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:sd.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/feedback-definitions"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:od.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/feedback-definitions/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:cd.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/feedback-definitions/${x.encodePathParam(o)}`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:wd.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PUT","/v1/private/feedback-definitions/{id}")}deleteFeedbackDefinitionById(o,e={},t){return _.fromPromise(this.__deleteFeedbackDefinitionById(o,e,t))}async __deleteFeedbackDefinitionById(o,e={},t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/feedback-definitions/${x.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:(R=this._options)==null?void 0:R.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/feedback-definitions/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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 ln=class{constructor(o={}){this._options=F(o);}createGuardrails(o,e){return _.fromPromise(this.__createGuardrails(o,e))}async __createGuardrails(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/guardrails"),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")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 mn=class{constructor(o={}){this._options=F(o);}deleteLlmProviderApiKeysBatch(o,e){return _.fromPromise(this.__deleteLlmProviderApiKeysBatch(o,e))}async __deleteLlmProviderApiKeysBatch(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/llm-provider-key/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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: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/llm-provider-key")}storeLlmProviderApiKey(o,e){return _.fromPromise(this.__storeLlmProviderApiKey(o,e))}async __storeLlmProviderApiKey(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/llm-provider-key"),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 401:throw new re(i.error.body,i.rawResponse);case 403:throw new se(ae.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/llm-provider-key/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:fi.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/llm-provider-key/${x.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:(R=this._options)==null?void 0:R.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 se(ae.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 dn=class{constructor(o={}){this._options=F(o);}evaluateSpans(o,e){return _.fromPromise(this.__evaluateSpans(o,e))}async __evaluateSpans(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/manual-evaluation/spans"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:li.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 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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/manual-evaluation/threads"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:li.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 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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/manual-evaluation/traces"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:li.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 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 un=class{constructor(o={}){this._options=F(o);}listModels(o,e){return _.fromPromise(this.__listModels(o,e))}async __listModels(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/ollama/models"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ya.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:Fr.listModels.Response.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 422:throw new Q(i.error.body,i.rawResponse);case 500:throw new pt(i.error.body,i.rawResponse);case 503:throw new Sr(ae.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/ollama/models")}testConnection(o,e){return _.fromPromise(this.__testConnection(o,e))}async __testConnection(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/ollama/test-connection"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ya.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:Qa.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 422:throw new Q(i.error.body,i.rawResponse);case 502:throw new st(Qa.parseOrThrow(i.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),i.rawResponse);case 503:throw new Sr(ae.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/ollama/test-connection")}};var fn=class{constructor(o={}){this._options=F(o);}receiveProtobufTraces(o){return _.fromPromise(this.__receiveProtobufTraces(o))}async __receiveProtobufTraces(o){var i,a,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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 hn=class{constructor(o={}){this._options=F(o);}cancelStudioOptimizations(o,e={},t){return _.fromPromise(this.__cancelStudioOptimizations(o,e,t))}async __cancelStudioOptimizations(o,e={},t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/optimizations/studio/${x.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:(R=this._options)==null?void 0:R.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 er(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,R,T,v,E,C,U,M;let{page:t,size:i,datasetId:a,name:n,datasetDeleted:p,filters:l}=o,c={page:t,size:i,dataset_id:a,name:n,dataset_deleted:p,filters:l},d=z((f=this._options)==null?void 0:f.headers,S({"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:x.join((R=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?R:P.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:Kd.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/optimizations"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Xa.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/optimizations"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Xa.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/optimizations/delete"),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: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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/optimizations/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:di.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/optimizations/${x.encodePathParam(o)}`),method:"PUT",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Ot.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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/optimizations/studio/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:eu.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 gn=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,R,T,v,E,C;let{page:t,size:i,name:a,sorting:n}=o,p={page:t,size:i,name:a,sorting:n},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/private/projects"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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:uu.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/projects"),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 422:throw new Q(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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/projects/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:ui.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/projects/${x.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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/projects/${x.encodePathParam(o)}`),method:"PATCH",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ro.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:(R=this._options)==null?void 0:R.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 Q(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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/projects/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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,R,T;let{projectIds:t}=o,i={project_ids:t},a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.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:(R=e==null?void 0:e.maxRetries)!=null?R:(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(n.ok)return {data:fd.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"GET","/v1/private/projects/feedback-scores/names")}findTokenUsageNames(o,e={},t){return _.fromPromise(this.__findTokenUsageNames(o,e,t))}async __findTokenUsageNames(o,e={},t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/projects/${x.encodePathParam(o)}/token-usage/names`),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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Vu.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}/token-usage/names")}getProjectMetrics(o,e={},t){return _.fromPromise(this.__getProjectMetrics(o,e,t))}async __getProjectMetrics(o,e={},t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/projects/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:mu.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,R,T,v,E,C;let{page:t,size:i,name:a,sorting:n}=o,p={page:t,size:i,name:a,sorting:n},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/private/projects/stats"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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:yu.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/projects/retrieve"),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:su.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 Q(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 yn=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,R,T,v,E,C,U;let{page:t,size:i,name:a,sorting:n,filters:p}=o,l={page:t,size:i,name:a,sorting:n,filters:p},c=z((m=this._options)==null?void 0:m.headers,S({"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:x.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:P.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:(R=this._options)==null?void 0:R.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:Au.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/prompts"),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")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 Q(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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/prompts/versions"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:oo.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 Q(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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/prompts/versions"),method:"PATCH",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 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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/prompts/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:ku.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/prompts/${x.encodePathParam(o)}`),method:"PUT",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:io.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:(R=this._options)==null?void 0:R.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 Q(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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/prompts/${x.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:(R=this._options)==null?void 0:R.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/prompts/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/prompts/versions/${x.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:(R=this._options)==null?void 0:R.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,R,T,v,E,C,U,M;let{page:i,size:a,search:n,sorting:p,filters:l}=e,c={page:i,size:a,search:n,sorting:p,filters:l},d=z((f=this._options)==null?void 0:f.headers,S({"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:x.join((R=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?R:P.Default,`v1/private/prompts/${x.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:Eu.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,R,T;let a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/prompts/${x.encodePathParam(o)}/versions/${x.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:(R=i==null?void 0:i.maxRetries)!=null?R:(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(n.ok)return {data:Ee.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new D(n.error.body,n.rawResponse);case 404:throw new I(n.error.body,n.rawResponse);default:throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return A(n.error,n.rawResponse,"POST","/v1/private/prompts/{promptId}/versions/{versionId}/restore")}retrievePromptVersion(o,e){return _.fromPromise(this.__retrievePromptVersion(o,e))}async __retrievePromptVersion(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/prompts/versions/retrieve"),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: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 Q(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 bn=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,R,T,v,E;let{datasetId:t,workspaceName:i,path:a}=o,n={dataset_id:t,workspace_name:i,path:a},p=z((c=this._options)==null?void 0:c.headers,S({"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:x.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:P.Default,"v1/session/redirect/datasets"),method:"GET",headers:p,queryParameters:{...n,...e==null?void 0:e.queryParams},timeoutMs:((R=(g=e==null?void 0:e.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?R: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,R,T,v,E,C;let{datasetId:t,experimentId:i,workspaceName:a,path:n}=o,p={dataset_id:t,experiment_id:i,workspace_name:a,path:n},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/session/redirect/experiments"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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,R,T,v,E,C;let{datasetId:t,optimizationId:i,workspaceName:a,path:n}=o,p={dataset_id:t,optimization_id:i,workspace_name:a,path:n},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/session/redirect/optimizations"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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,R,T,v,E;let{traceId:t,workspaceName:i,path:a}=o,n={trace_id:t,workspace_name:i,path:a},p=z((c=this._options)==null?void 0:c.headers,S({"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:x.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:P.Default,"v1/session/redirect/projects"),method:"GET",headers:p,queryParameters:{...n,...e==null?void 0:e.queryParams},timeoutMs:((R=(g=e==null?void 0:e.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?R: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 Rn=class{constructor(o={}){this._options=F(o);}getServiceToggles(o){return _.fromPromise(this.__getServiceToggles(o))}async __getServiceToggles(o){var i,a,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Uu.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 xn=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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/spans/${x.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/spans/${x.encodePathParam(o)}/feedback-scores`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:pe.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PUT","/v1/private/spans/{id}/feedback-scores")}createSpans(o,e){return _.fromPromise(this.__createSpans(o,e))}async __createSpans(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/spans/batch"),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/spans/batch")}batchUpdateSpans(o,e){return _.fromPromise(this.__batchUpdateSpans(o,e))}async __batchUpdateSpans(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/spans/batch"),method:"PATCH",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 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,Z,ie,ze,ke,Ve,tt,ot;let{page:t,size:i,projectName:a,projectId:n,traceId:p,type:l,filters:c,truncate:d,stripAttachments:m,sorting:f,exclude:u,fromTime:h,toTime:g}=o,R={page:t,size:i,project_name:a,project_id:n,trace_id:p,type:l!=null?Wa.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,S({"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:x.join((Z=(M=await b.get(this._options.baseUrl))!=null?M:await b.get(this._options.environment))!=null?Z:P.Default,"v1/private/spans"),method:"GET",headers:T,queryParameters:{...R,...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:(tt=e==null?void 0:e.maxRetries)!=null?tt:(Ve=this._options)==null?void 0:Ve.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(ot=this._options)==null?void 0:ot.fetch,logging:this._options.logging});if(v.ok)return {data:Nu.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/spans"),method:"POST",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===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,R,T,v;let{stripAttachments:i}=e,a={strip_attachments:i},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,`v1/private/spans/${x.encodePathParam(o)}`),method:"GET",headers:n,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:(R=this._options)==null?void 0:R.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:hi.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/spans/${x.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:(R=this._options)==null?void 0:R.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 er(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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/spans/${x.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:po.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PATCH","/v1/private/spans/{id}")}deleteSpanComments(o,e){return _.fromPromise(this.__deleteSpanComments(o,e))}async __deleteSpanComments(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/spans/comments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/spans/${x.encodePathParam(o)}/feedback-scores/delete`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ri.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v;let{projectId:t,type:i}=o,a={project_id:t,type:i!=null?Na.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,"v1/private/spans/feedback-scores/names"),method:"GET",headers:n,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:(R=this._options)==null?void 0:R.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:Nr.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,R,T;let a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/spans/${x.encodePathParam(o)}/comments/${x.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:(R=i==null?void 0:i.maxRetries)!=null?R:(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(n.ok)return {data:O.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v,E,C,U,M,Z;let{projectId:t,projectName:i,traceId:a,type:n,filters:p,fromTime:l,toTime:c}=o,d={project_id:t,project_name:i,trace_id:a,type:n!=null?Ma.jsonOrThrow(n,{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,S({"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:x.join((T=(R=await b.get(this._options.baseUrl))!=null?R:await b.get(this._options.environment))!=null?T:P.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:(Z=this._options)==null?void 0:Z.fetch,logging:this._options.logging});if(f.ok)return {data:Ge.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/spans/feedback-scores"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ci.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/spans/search"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:fo.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/spans/comments/${x.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PATCH","/v1/private/spans/comments/{commentId}")}};var wn=class{constructor(o={}){this._options=F(o);}getDatasetBiInfo(o){return _.fromPromise(this.__getDatasetBiInfo(o))}async __getDatasetBiInfo(o){var i,a,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Hr.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Hr.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Hr.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Hr.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Hu.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 _n=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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/threads/${x.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/${x.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/${x.encodePathParam(o)}/feedback-scores`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:pe.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PUT","/v1/private/traces/{id}/feedback-scores")}createTraces(o,e){return _.fromPromise(this.__createTraces(o,e))}async __createTraces(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:wo.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/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/batch")}batchUpdateThreads(o,e){return _.fromPromise(this.__batchUpdateThreads(o,e))}async __batchUpdateThreads(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/batch"),method:"PATCH",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 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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/close"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:zo.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,Z,ie,ze,ke,Ve;let{page:t,size:i,projectName:a,projectId:n,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:n,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,S({"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),R=await k({url:x.join((U=(C=await b.get(this._options.baseUrl))!=null?C:await b.get(this._options.environment))!=null?U:P.Default,"v1/private/traces"),method:"GET",headers:g,queryParameters:{...h,...e==null?void 0:e.queryParams},timeoutMs:((ie=(Z=e==null?void 0:e.timeoutInSeconds)!=null?Z:(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(R.ok)return {data:Gu.parseOrThrow(R.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:R.rawResponse};if(R.error.reason==="status-code")throw new w({statusCode:R.error.statusCode,body:R.error.body,rawResponse:R.rawResponse});return A(R.error,R.rawResponse,"GET","/v1/private/traces")}createTrace(o,e){return _.fromPromise(this.__createTrace(o,e))}async __createTrace(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:xo.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,R,T,v;let{stripAttachments:i}=e,a={strip_attachments:i},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,`v1/private/traces/${x.encodePathParam(o)}`),method:"GET",headers:n,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:(R=this._options)==null?void 0:R.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:gi.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/traces/${x.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:(R=this._options)==null?void 0:R.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/${x.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:bo.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PATCH","/v1/private/traces/{id}")}deleteThreadComments(o,e){return _.fromPromise(this.__deleteThreadComments(o,e))}async __deleteThreadComments(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/comments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.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: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/threads/feedback-scores/delete")}deleteTraceComments(o,e){return _.fromPromise(this.__deleteTraceComments(o,e))}async __deleteTraceComments(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/comments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/${x.encodePathParam(o)}/feedback-scores/delete`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ri.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"POST","/v1/private/traces/{id}/feedback-scores/delete")}deleteTraceThreads(o,e){return _.fromPromise(this.__deleteTraceThreads(o,e))}async __deleteTraceThreads(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/delete"),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/threads/delete")}deleteTraces(o,e){return _.fromPromise(this.__deleteTraces(o,e))}async __deleteTraces(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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,R,T;let{projectId:t}=o,i={project_id:t},a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.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:(R=e==null?void 0:e.maxRetries)!=null?R:(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(n.ok)return {data:nr.findFeedbackScoreNames2.Response.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T;let{projectId:t}=o,i={project_id:t},a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.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:(R=e==null?void 0:e.maxRetries)!=null?R:(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(n.ok)return {data:nr.findTraceThreadsFeedbackScoreNames.Response.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v,E,C,U;let{projectId:t,projectName:i,filters:a,fromTime:n,toTime:p}=o,l={project_id:t,project_name:i,filters:a,from_time:n==null?void 0:n.toISOString(),to_time:p==null?void 0:p.toISOString()},c=z((m=this._options)==null?void 0:m.headers,S({"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:x.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:P.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:(R=this._options)==null?void 0:R.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:Ge.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,R,T;let a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/threads/${x.encodePathParam(o)}/comments/${x.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:(R=i==null?void 0:i.maxRetries)!=null?R:(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(n.ok)return {data:O.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v,E,C,U;let{projectId:t,projectName:i,filters:a,fromTime:n,toTime:p}=o,l={project_id:t,project_name:i,filters:a,from_time:n==null?void 0:n.toISOString(),to_time:p==null?void 0:p.toISOString()},c=z((m=this._options)==null?void 0:m.headers,S({"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:x.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:P.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:(R=this._options)==null?void 0:R.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:Ge.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,R,T;let a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/${x.encodePathParam(o)}/comments/${x.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:(R=i==null?void 0:i.maxRetries)!=null?R:(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(n.ok)return {data:O.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"GET","/v1/private/traces/{traceId}/comments/{commentId}")}getTraceThread(o,e){return _.fromPromise(this.__getTraceThread(o,e))}async __getTraceThread(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/retrieve"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Za.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:yi.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 R,T,v,E,C,U,M,Z,ie,ze,ke;let{page:t,size:i,projectName:a,projectId:n,truncate:p,stripAttachments:l,filters:c,sorting:d,fromTime:m,toTime:f}=o,u={page:t,size:i,project_name:a,project_id:n,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((R=this._options)==null?void 0:R.headers,S({"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:x.join((C=(E=await b.get(this._options.baseUrl))!=null?E:await b.get(this._options.environment))!=null?C:P.Default,"v1/private/traces/threads"),method:"GET",headers:h,queryParameters:{...u,...e==null?void 0:e.queryParams},timeoutMs:((Z=(M=e==null?void 0:e.timeoutInSeconds)!=null?M:(U=this._options)==null?void 0:U.timeoutInSeconds)!=null?Z: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:$u.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/open"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Za.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/feedback-scores"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:yo.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/feedback-scores"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ci.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/search"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:So.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/search"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:_o.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/threads/${x.encodePathParam(o)}`),method:"PATCH",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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/threads/comments/${x.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/comments/${x.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PATCH","/v1/private/traces/comments/{commentId}")}};var zn=class{constructor(o={}){this._options=F(o);}getWelcomeWizardStatus(o){return _.fromPromise(this.__getWelcomeWizardStatus(o))}async __getWelcomeWizardStatus(o){var i,a,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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: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/private/welcome-wizard")}submitWelcomeWizard(o={},e){return _.fromPromise(this.__submitWelcomeWizard(o,e))}async __submitWelcomeWizard(o={},e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/welcome-wizard"),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/welcome-wizard")}};var kn=class{constructor(o={}){this._options=F(o);}costsSummary(o,e){return _.fromPromise(this.__costsSummary(o,e))}async __costsSummary(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/workspaces/costs/summaries"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:$r.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:Rr.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:bi.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/workspaces/configurations"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:bi.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:bi.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 Q(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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/workspaces/costs"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:$r.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:Oa.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/workspaces/metrics"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:$r.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:Oa.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/workspaces/metrics/summaries"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:$r.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:Ou.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 Ri=class{constructor(o={}){this._options=F(o);}get systemUsage(){var o;return (o=this._systemUsage)!=null?o:this._systemUsage=new wn(this._options)}get alerts(){var o;return (o=this._alerts)!=null?o:this._alerts=new qa(this._options)}get annotationQueues(){var o;return (o=this._annotationQueues)!=null?o:this._annotationQueues=new en(this._options)}get attachments(){var o;return (o=this._attachments)!=null?o:this._attachments=new rn(this._options)}get check(){var o;return (o=this._check)!=null?o:this._check=new an(this._options)}get automationRuleEvaluators(){var o;return (o=this._automationRuleEvaluators)!=null?o:this._automationRuleEvaluators=new tn(this._options)}get chatCompletions(){var o;return (o=this._chatCompletions)!=null?o:this._chatCompletions=new on(this._options)}get dashboards(){var o;return (o=this._dashboards)!=null?o:this._dashboards=new nn(this._options)}get datasets(){var o;return (o=this._datasets)!=null?o:this._datasets=new sn(this._options)}get experiments(){var o;return (o=this._experiments)!=null?o:this._experiments=new pn(this._options)}get feedbackDefinitions(){var o;return (o=this._feedbackDefinitions)!=null?o:this._feedbackDefinitions=new cn(this._options)}get guardrails(){var o;return (o=this._guardrails)!=null?o:this._guardrails=new ln(this._options)}get llmProviderKey(){var o;return (o=this._llmProviderKey)!=null?o:this._llmProviderKey=new mn(this._options)}get manualEvaluation(){var o;return (o=this._manualEvaluation)!=null?o:this._manualEvaluation=new dn(this._options)}get ollama(){var o;return (o=this._ollama)!=null?o:this._ollama=new un(this._options)}get openTelemetryIngestion(){var o;return (o=this._openTelemetryIngestion)!=null?o:this._openTelemetryIngestion=new fn(this._options)}get optimizations(){var o;return (o=this._optimizations)!=null?o:this._optimizations=new hn(this._options)}get projects(){var o;return (o=this._projects)!=null?o:this._projects=new gn(this._options)}get prompts(){var o;return (o=this._prompts)!=null?o:this._prompts=new yn(this._options)}get serviceToggles(){var o;return (o=this._serviceToggles)!=null?o:this._serviceToggles=new Rn(this._options)}get spans(){var o;return (o=this._spans)!=null?o:this._spans=new xn(this._options)}get traces(){var o;return (o=this._traces)!=null?o:this._traces=new _n(this._options)}get welcomeWizard(){var o;return (o=this._welcomeWizard)!=null?o:this._welcomeWizard=new zn(this._options)}get workspaces(){var o;return (o=this._workspaces)!=null?o:this._workspaces=new kn(this._options)}get redirect(){var o;return (o=this._redirect)!=null?o:this._redirect=new bn(this._options)}isAlive(o){return _.fromPromise(this.__isAlive(o))}async __isAlive(o){var i,a,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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 Oh;(e=>(e.LogLevel=fe,e.ConsoleLogger=rr))(Oh||(Oh={}));var ne=()=>uuid.v7();var Qr=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),n=this.normalizeMetadata(e);return {...a,...n,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 Pn=class s{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=Qr.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:ne(),startTime:new Date,...o,projectName:e,traceId:this.data.traceId,parentSpanId:this.data.id};this.opik.spanBatchQueue.create(t);let i=new s(t,this.opik);return this.childSpans.push(i),i};}};var Sn=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,n;let e=(n=(a=this.data.projectName)!=null?a:o.projectName)!=null?n:this.opik.config.projectName,t={id:ne(),startTime:new Date,...o,projectName:e,traceId:this.data.id};this.opik.spanBatchQueue.create(t);let i=new Pn(t,this.opik);return this.spans.push(i),i};this.update=o=>{var i;let e=Qr.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 qh={EXPERIMENTS:"api/v1/session/redirect/experiments/",PROJECTS:"api/v1/session/redirect/projects/"},xi={EXPERIMENT_ID:"experiment_id",DATASET_ID:"dataset_id",TRACE_ID:"trace_id",PATH:"path"},Sx=s=>Object.entries(s).map(([o,e])=>`${o}=${encodeURIComponent(e)}`).join("&").replace(/%3A/g,":").replace(/%2F/g,"/").replace(/%26/g,"&").replace(/%3F/g,"?").replace(/%3D/g,"=");var eg=s=>Buffer.from(s).toString("base64"),rg=(s,o,e)=>{let t=Sx(e),i=`${o}?${t}`;return new URL(i,s).toString()},tg=({datasetId:s,experimentId:o,baseUrl:e})=>rg(e,qh.EXPERIMENTS,{[xi.EXPERIMENT_ID]:o,[xi.DATASET_ID]:s,[xi.PATH]:eg(e)}),og=(s,o)=>rg(o,qh.PROJECTS,{[xi.TRACE_ID]:s,[xi.PATH]:eg(o)});var Ax=300,An=100,wi=class{constructor({action:o,batchSize:e=An,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;}},Re=class{constructor({delay:o=Ax,enableCreateBatch:e=true,enableUpdateBatch:t=false,enableDeleteBatch:i=true,createBatchSize:a=An,updateBatchSize:n=An,deleteBatchSize:p=An,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 wi({action:async c=>{await this.createEntities(Array.from(c.values()));},delay:o,enableBatch:e,batchSize:a,name:`${l}:createQueue`}),this.updateQueue=new wi({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:n,name:`${l}:updateQueue`}),this.deleteQueue=new wi({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 Tn=class extends Re{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 vn=class extends Re{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 jn=class extends Re{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 En=class extends Re{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 Cn=class extends Ri{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 In=class extends Re{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 ef=null;async function ig(){return ef||(ef=await Tx__default.default()),ef}var _i=class s{constructor(o){let{id:e,traceId:t,spanId:i,source:a,...n}=o;this.id=e||ne(),this.traceId=t,this.spanId=i,this.source=a||ws.Sdk,this.data={...n};}getContent(o=false){return o?{...this.data,id:this.id}:{...this.data}}async contentHash(){let o=this.getContent(),e=vx__default.default(o);return (await ig()).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 s({id:o.id,traceId:o.traceId,spanId:o.spanId,source:o.source,...o.data})}};async function Ke(s,o,e){var p;if(e===0)return [];let t=new util.TextDecoder("utf-8"),i=[],a="",n=s.getReader();try{for(;;){let{done:l,value:c}=await n.read();if(l)break;let d=c;a+=t.decode(d,{stream:!0});let m=a.split(`
3
+ `)),{ok:true,value:o}):t}}function Zi(s){return s.path.length===0?s.message:`${s.path.join(" -> ")}: ${s.message}`}var vr=class s extends Error{constructor(e){super(e.map(Zi).join("; "));this.errors=e;Object.setPrototypeOf(this,s.prototype);}};var jr=class s extends Error{constructor(e){super(e.map(Zi).join("; "));this.errors=e;Object.setPrototypeOf(this,s.prototype);}};function J(s){return {nullable:()=>VR(s),optional:()=>Us(s),optionalNullable:()=>LR(s),transform:o=>Fs(s,o),parseOrThrow:(o,e)=>{let t=s.parse(o,e);if(t.ok)return t.value;throw new jr(t.errors)},jsonOrThrow:(o,e)=>{let t=s.json(o,e);if(t.ok)return t.value;throw new vr(t.errors)}}}function VR(s){let o={parse:(e,t)=>e==null?{ok:true,value:null}:s.parse(e,t),json:(e,t)=>e==null?{ok:true,value:null}:s.json(e,t),getType:()=>N.NULLABLE};return {...o,...J(o)}}function Us(s){let o={parse:(e,t)=>e==null?{ok:true,value:void 0}:s.parse(e,t),json:(e,t)=>t!=null&&t.omitUndefined&&e===void 0?{ok:true,value:void 0}:e==null?{ok:true,value:null}:s.json(e,t),getType:()=>N.OPTIONAL};return {...o,...J(o)}}function LR(s){let o={parse:(e,t)=>e===void 0?{ok:true,value:void 0}:e===null?{ok:true,value:null}:s.parse(e,t),json:(e,t)=>e===void 0?{ok:true,value:void 0}:e===null?{ok:true,value:null}:s.json(e,t),getType:()=>N.OPTIONAL_NULLABLE};return {...o,...J(o)}}function Fs(s,o){let e={parse:(t,i)=>{let a=s.parse(t,i);return a.ok?{ok:true,value:o.transform(a.value)}:a},json:(t,i)=>{let a=o.untransform(t);return s.json(a,i)},getType:()=>s.getType()};return {...e,...J(e)}}function xh(){let s={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:H(o,"bigint | number")}]},json:(o,{breadcrumbsPrefix:e=[]}={})=>typeof o!="bigint"?{ok:false,errors:[{path:e,message:H(o,"bigint")}]}:{ok:true,value:o},getType:()=>N.BIGINT};return {...te(s),...J(s)}}var HR=/^([+-]?\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 wh(){let s={parse:(o,{breadcrumbsPrefix:e=[]}={})=>typeof o!="string"?{ok:false,errors:[{path:e,message:H(o,"string")}]}:HR.test(o)?{ok:true,value:new Date(o)}:{ok:false,errors:[{path:e,message:H(o,"ISO 8601 date string")}]},json:(o,{breadcrumbsPrefix:e=[]}={})=>o instanceof Date?{ok:true,value:o.toISOString()}:{ok:false,errors:[{path:e,message:H(o,"Date object")}]},getType:()=>N.DATE};return {...te(s),...J(s)}}function oe(s,o){return ()=>{let e={parse:o,json:o,getType:()=>s};return {...te(e),...J(e)}}}function Oi(s){let o=new Set(s);return oe(N.ENUM,(t,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:a=[]}={})=>typeof t!="string"?{ok:false,errors:[{path:a,message:H(t,"string")}]}:!o.has(t)&&!i?{ok:false,errors:[{path:a,message:H(t,"enum")}]}:{ok:true,value:t})()}function _h(s){let o=Ns(s);return {...o,...J(o)}}function Ns(s){return {parse:(o,e)=>Er(s).parse(o,e),json:(o,e)=>Er(s).json(o,e),getType:()=>Er(s).getType()}}function Er(s){let o=s;return o.__zurg_memoized==null&&(o.__zurg_memoized=s()),o.__zurg_memoized}function lt(s){return Object.entries(s)}function mt(s,o){let e=new Set(o);return Object.entries(s).reduce((t,[i,a])=>(e.has(i)&&(t[i]=a),t),{})}function Ie(s){if(typeof s!="object"||s===null)return false;if(Object.getPrototypeOf(s)===null)return true;let o=s;for(;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return Object.getPrototypeOf(s)===o}function dt(s){return Object.keys(s)}function zh(s,o){let e=[],t=[];for(let i of s)o(i)?e.push(i):t.push(i);return [e,t]}function Se(s){return {withParsedProperties:o=>Ms(s,o)}}function Ms(s,o){let e={parse:(t,i)=>{let a=s.parse(t,i);if(!a.ok)return a;let n=Object.entries(o).reduce((p,[l,c])=>({...p,[l]:typeof c=="function"?c(a.value):c}),{});return {ok:true,value:{...a.value,...n}}},json:(t,i)=>{var p;if(!Ie(t))return {ok:false,errors:[{path:(p=i==null?void 0:i.breadcrumbsPrefix)!=null?p:[],message:H(t,"object")}]};let a=new Set(Object.keys(o)),n=mt(t,Object.keys(t).filter(l=>!a.has(l)));return s.json(n,i)},getType:()=>s.getType()};return {...e,...J(e),...Se(e)}}function kh(s,o){return {rawKey:s,valueSchema:o,isProperty:true}}function He(s){return s.isProperty}function qi(s){let o={_getRawProperties:()=>Object.entries(s).map(([e,t])=>He(t)?t.rawKey:e),_getParsedProperties:()=>dt(s),parse:(e,t)=>{let i={},a=[];for(let[n,p]of lt(s)){let l=He(p)?p.rawKey:n,c=He(p)?p.valueSchema:p,d={rawKey:l,parsedKey:n,valueSchema:c};i[l]=d,Ah(c)&&a.push(l);}return Ph({value:e,requiredKeys:a,getProperty:n=>{let p=i[n];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:[],n]})}}},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,n]of lt(s)){let p=He(n)?n.valueSchema:n;Ah(p)&&i.push(a);}return Ph({value:e,requiredKeys:i,getProperty:a=>{let n=s[a];if(n!=null)return He(n)?{transformedKey:n.rawKey,transform:p=>{var l;return n.valueSchema.json(p,{...t,breadcrumbsPrefix:[...(l=t==null?void 0:t.breadcrumbsPrefix)!=null?l:[],a]})}}:{transformedKey:a,transform:p=>{var l;return n.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),...Se(o),...ir(o)}}function Ph({value:s,requiredKeys:o,getProperty:e,unrecognizedObjectKeys:t="fail",skipValidation:i=false,breadcrumbsPrefix:a=[]}){if(!Ie(s))return {ok:false,errors:[{path:a,message:H(s,"object")}]};let n=new Set(o),p=[],l={};for(let[c,d]of Object.entries(s)){let m=e(c);if(m!=null){n.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=>n.has(c)).map(c=>({path:a,message:`Missing required key "${c}"`}))),p.length===0||i?{ok:true,value:l}:{ok:false,errors:p}}function ir(s){return {extend:o=>{let e={_getParsedProperties:()=>[...s._getParsedProperties(),...o._getParsedProperties()],_getRawProperties:()=>[...s._getRawProperties(),...o._getRawProperties()],parse:(t,i)=>Sh({extensionKeys:o._getRawProperties(),value:t,transformBase:a=>s.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=>s.json(a,i),transformExtension:a=>o.json(a,i),breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),getType:()=>N.OBJECT};return {...e,...J(e),...Se(e),...ir(e)}},passthrough:()=>{let o=new Set(s._getRawProperties()),e=new Set(s._getParsedProperties()),t={_getParsedProperties:()=>s._getParsedProperties(),_getRawProperties:()=>s._getRawProperties(),parse:(i,a)=>{let n=s.parse(i,{...a,unrecognizedObjectKeys:"passthrough"});if(!n.ok)return n;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,...n.value}}},json:(i,a)=>{let n=s.json(i,{...a,unrecognizedObjectKeys:"passthrough"});if(!n.ok)return n;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,...n.value}}},getType:()=>N.OBJECT};return {...t,...J(t),...Se(t),...ir(t)}}}}function Sh({extensionKeys:s,value:o,transformBase:e,transformExtension:t,breadcrumbsPrefix:i=[]}){if(!Ie(o))return {ok:false,errors:[{path:i,message:H(o,"object")}]};let a=new Set(s),[n,p]=zh(dt(o),d=>a.has(d)),l=e(mt(o,p)),c=t(mt(o,n));return l.ok&&c.ok?{ok:true,value:{...l.value,...c.value}}:{ok:false,errors:[...l.ok?[]:l.errors,...c.ok?[]:c.errors]}}function Ah(s){return !JR(s)}function JR(s){switch(s.getType()){case N.ANY:case N.UNKNOWN:case N.OPTIONAL:case N.OPTIONAL_NULLABLE:return true;default:return false}}function Th(s){return qi(s)}function vh(s){let o={...Ns(s),_getRawProperties:()=>Er(s)._getRawProperties(),_getParsedProperties:()=>Er(s)._getParsedProperties()};return {...o,...J(o),...Se(o),...ir(o)}}function ea(s){let o={parse:(e,t)=>jh(e,(i,a)=>{var n;return s.parse(i,{...t,breadcrumbsPrefix:[...(n=t==null?void 0:t.breadcrumbsPrefix)!=null?n:[],`[${a}]`]})}),json:(e,t)=>jh(e,(i,a)=>{var n;return s.json(i,{...t,breadcrumbsPrefix:[...(n=t==null?void 0:t.breadcrumbsPrefix)!=null?n:[],`[${a}]`]})}),getType:()=>N.LIST};return {...te(o),...J(o)}}function jh(s,o){return Array.isArray(s)?s.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:H(s,"list"),path:[]}]}}function Eh(s){return oe(N.BOOLEAN_LITERAL,(e,{breadcrumbsPrefix:t=[]}={})=>e===s?{ok:true,value:s}:{ok:false,errors:[{path:t,message:H(e,`${s.toString()}`)}]})()}function Ch(s){return oe(N.STRING_LITERAL,(e,{breadcrumbsPrefix:t=[]}={})=>e===s?{ok:true,value:s}:{ok:false,errors:[{path:t,message:H(e,`"${s}"`)}]})()}var Ih=oe(N.ANY,s=>({ok:true,value:s}));var Dh=oe(N.BOOLEAN,(s,{breadcrumbsPrefix:o=[]}={})=>typeof s=="boolean"?{ok:true,value:s}:{ok:false,errors:[{path:o,message:H(s,"boolean")}]});var Uh=oe(N.NEVER,(s,{breadcrumbsPrefix:o=[]}={})=>({ok:false,errors:[{path:o,message:"Expected never"}]}));var Fh=oe(N.NUMBER,(s,{breadcrumbsPrefix:o=[]}={})=>typeof s=="number"?{ok:true,value:s}:{ok:false,errors:[{path:o,message:H(s,"number")}]});var Nh=oe(N.STRING,(s,{breadcrumbsPrefix:o=[]}={})=>typeof s=="string"?{ok:true,value:s}:{ok:false,errors:[{path:o,message:H(s,"string")}]});var Mh=oe(N.UNKNOWN,s=>({ok:true,value:s}));function Bh(s,o){let e={parse:(t,i)=>Wh({value:t,isKeyNumeric:s.getType()===N.NUMBER,transformKey:a=>{var n;return s.parse(a,{...i,breadcrumbsPrefix:[...(n=i==null?void 0:i.breadcrumbsPrefix)!=null?n:[],`${a} (key)`]})},transformValue:(a,n)=>{var p;return o.parse(a,{...i,breadcrumbsPrefix:[...(p=i==null?void 0:i.breadcrumbsPrefix)!=null?p:[],`${n}`]})},breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),json:(t,i)=>Wh({value:t,isKeyNumeric:s.getType()===N.NUMBER,transformKey:a=>{var n;return s.json(a,{...i,breadcrumbsPrefix:[...(n=i==null?void 0:i.breadcrumbsPrefix)!=null?n:[],`${a} (key)`]})},transformValue:(a,n)=>{var p;return o.json(a,{...i,breadcrumbsPrefix:[...(p=i==null?void 0:i.breadcrumbsPrefix)!=null?p:[],`${n}`]})},breadcrumbsPrefix:i==null?void 0:i.breadcrumbsPrefix}),getType:()=>N.RECORD};return {...te(e),...J(e)}}function Wh({value:s,isKeyNumeric:o,transformKey:e,transformValue:t,breadcrumbsPrefix:i=[]}){return Ie(s)?lt(s).reduce((a,[n,p])=>{if(p===void 0)return a;let l=a,c=n;if(o){let u=n.length>0?Number(n):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:H(s,"object")}]}}function Vh(s){let o=ea(s),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 n;return t instanceof Set?o.json([...t],i):{ok:false,errors:[{path:(n=i==null?void 0:i.breadcrumbsPrefix)!=null?n:[],message:H(t,"Set")}]}},getType:()=>N.SET};return {...te(e),...J(e)}}function Hh(s){let o={parse:(e,t)=>Lh((i,a)=>i.parse(e,a),s,t),json:(e,t)=>Lh((i,a)=>i.json(e,a),s,t),getType:()=>N.UNDISCRIMINATED_UNION};return {...te(o),...J(o)}}function Lh(s,o,e){let t=[];for(let[i,a]of o.entries()){let n=s(a,{...e,skipValidation:false});if(n.ok)return n;for(let p of n.errors)t.push({path:p.path,message:`[Variant ${i}] ${p.message}`});}return {ok:false,errors:t}}function Jh(s,o){return {parsedDiscriminant:s,rawDiscriminant:o}}function Kh(s,o){let e=typeof s=="string"?s:s.rawDiscriminant,t=typeof s=="string"?s:s.parsedDiscriminant,i=Oi(dt(o)),a={parse:(n,p)=>Gh({value:n,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:(n,p)=>Gh({value:n,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),...Se(a)}}function Gh({value:s,discriminant:o,transformedDiscriminant:e,transformDiscriminantValue:t,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:a=false,transformAdditionalProperties:n,breadcrumbsPrefix:p=[]}){if(!Ie(s))return {ok:false,errors:[{path:p,message:H(s,"object")}]};let{[o]:l,...c}=s;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=n(c,m);return f.ok?{ok:true,value:{[e]:l,...f.value}}:f}var x={};W(x,{encodePathParam:()=>$h,join:()=>Yh,toQueryString:()=>tr});function $h(s){if(s===null)return "null";switch(typeof s){case "undefined":return "undefined";case "string":case "number":case "boolean":break;default:s=String(s);break}return encodeURIComponent(s)}function Yh(s,...o){if(!s)return "";if(o.length===0)return s;if(s.includes("://")){let e;try{e=new URL(s);}catch{return Qh(s,...o)}let t=o[o.length-1],i=t==null?void 0:t.endsWith("/");for(let a of o){let n=Zh(a);n&&(e.pathname=Xh(e.pathname,n));}return i&&!e.pathname.endsWith("/")&&(e.pathname+="/"),e.toString()}return Qh(s,...o)}function Qh(s,...o){if(o.length===0)return s;let e=s,t=o[o.length-1],i=t==null?void 0:t.endsWith("/");for(let a of o){let n=Zh(a);n&&(e=Xh(e,n));}return i&&!e.endsWith("/")&&(e+="/"),e}function Xh(s,o){return s.endsWith("/")?s+o:`${s}/${o}`}function Zh(s){if(!s)return s;let o=0,e=s.length;return s.startsWith("/")&&(o=1),s.endsWith("/")&&(e=s.length-1),o===0&&e===s.length?s:s.slice(o,e)}function F(s){let o=z({"X-Fern-Language":"JavaScript","X-Fern-Runtime":Tr.type,"X-Fern-Runtime-Version":Tr.version,"Comet-Workspace":s==null?void 0:s.workspaceName},s==null?void 0:s.headers);return {...s,logging:ct.createLogger(s==null?void 0:s.logging),headers:o}}var P={Default:"http://localhost:5173/api"};function A(s,o,e,t){switch(s.reason){case "non-json":throw new w({statusCode:s.statusCode,body:s.rawBody,rawResponse:o});case "body-is-null":throw new w({statusCode:s.statusCode,rawResponse:o});case "timeout":throw new Pr(`Timeout exceeded when calling ${e} ${t}.`);case "unknown":throw new w({message:s.errorMessage,rawResponse:o});default:throw new w({message:"Unknown error",rawResponse:o})}}var L={};W(L,{AggregationData:()=>Cp,Alert:()=>OR,AlertAlertType:()=>Ip,AlertPagePublic:()=>Gp,AlertPublic:()=>To,AlertPublicAlertType:()=>Wp,AlertTrigger:()=>Np,AlertTriggerConfig:()=>Up,AlertTriggerConfigPublic:()=>Vp,AlertTriggerConfigPublicType:()=>Bp,AlertTriggerConfigType:()=>Dp,AlertTriggerConfigWrite:()=>$p,AlertTriggerConfigWriteType:()=>Kp,AlertTriggerEventType:()=>Fp,AlertTriggerPublic:()=>Hp,AlertTriggerPublicEventType:()=>Lp,AlertTriggerWrite:()=>Yp,AlertTriggerWriteEventType:()=>Qp,AlertWrite:()=>vo,AlertWriteAlertType:()=>Xp,AnnotationQueue:()=>ec,AnnotationQueueBatch:()=>qR,AnnotationQueueBatchWrite:()=>ft,AnnotationQueueItemIds:()=>Ha,AnnotationQueuePagePublic:()=>oc,AnnotationQueuePublic:()=>jo,AnnotationQueuePublicScope:()=>rc,AnnotationQueueReviewer:()=>Op,AnnotationQueueReviewerPublic:()=>tc,AnnotationQueueScope:()=>qp,AnnotationQueueUpdate:()=>ht,AnnotationQueueWrite:()=>ut,AnnotationQueueWriteScope:()=>Ws,AssistantMessage:()=>nc,AssistantMessageRole:()=>ic,Attachment:()=>sc,AttachmentListRequestEntityType:()=>na,AttachmentPage:()=>pc,AudioUrl:()=>cc,AudioUrlPublic:()=>lc,AudioUrlWrite:()=>mc,AuthDetailsHolder:()=>dc,AutomationRuleEvaluator:()=>ex,AutomationRuleEvaluatorAction:()=>uc,AutomationRuleEvaluatorLlmAsJudge:()=>xc,AutomationRuleEvaluatorLlmAsJudgePublic:()=>Mo,AutomationRuleEvaluatorLlmAsJudgeWrite:()=>Vc,AutomationRuleEvaluatorObjectObjectPublic:()=>Qc,AutomationRuleEvaluatorObjectObjectPublicAction:()=>Lc,AutomationRuleEvaluatorPagePublic:()=>Yc,AutomationRuleEvaluatorPublic:()=>Zc,AutomationRuleEvaluatorPublicAction:()=>Xc,AutomationRuleEvaluatorSpanLlmAsJudge:()=>_c,AutomationRuleEvaluatorSpanLlmAsJudgePublic:()=>Bo,AutomationRuleEvaluatorSpanLlmAsJudgeWrite:()=>el,AutomationRuleEvaluatorSpanUserDefinedMetricPython:()=>zc,AutomationRuleEvaluatorSpanUserDefinedMetricPythonPublic:()=>Vo,AutomationRuleEvaluatorSpanUserDefinedMetricPythonWrite:()=>tl,AutomationRuleEvaluatorTraceThreadLlmAsJudge:()=>kc,AutomationRuleEvaluatorTraceThreadLlmAsJudgePublic:()=>Lo,AutomationRuleEvaluatorTraceThreadLlmAsJudgeWrite:()=>al,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPython:()=>Pc,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonPublic:()=>Ho,AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonWrite:()=>sl,AutomationRuleEvaluatorUpdate:()=>hl,AutomationRuleEvaluatorUpdateAction:()=>pl,AutomationRuleEvaluatorUpdateLlmAsJudge:()=>cl,AutomationRuleEvaluatorUpdateSpanLlmAsJudge:()=>ll,AutomationRuleEvaluatorUpdateSpanUserDefinedMetricPython:()=>ml,AutomationRuleEvaluatorUpdateTraceThreadLlmAsJudge:()=>dl,AutomationRuleEvaluatorUpdateTraceThreadUserDefinedMetricPython:()=>ul,AutomationRuleEvaluatorUpdateUserDefinedMetricPython:()=>fl,AutomationRuleEvaluatorUserDefinedMetricPython:()=>Sc,AutomationRuleEvaluatorUserDefinedMetricPythonPublic:()=>Jo,AutomationRuleEvaluatorUserDefinedMetricPythonWrite:()=>yl,AutomationRuleEvaluatorWrite:()=>Rl,AutomationRuleEvaluatorWriteAction:()=>bl,AvgValueStatPublic:()=>xl,BatchDelete:()=>X,BatchDeleteByProject:()=>rx,BiInformation:()=>wl,BiInformationResponse:()=>Hr,BooleanFeedbackDefinition:()=>zl,BooleanFeedbackDefinitionCreate:()=>Pl,BooleanFeedbackDefinitionPublic:()=>Qo,BooleanFeedbackDefinitionUpdate:()=>Tl,BooleanFeedbackDetail:()=>_l,BooleanFeedbackDetailCreate:()=>kl,BooleanFeedbackDetailPublic:()=>Sl,BooleanFeedbackDetailUpdate:()=>Al,BreakdownConfigPublic:()=>Rp,BreakdownConfigPublicField:()=>bp,CategoricalFeedbackDefinition:()=>jl,CategoricalFeedbackDefinitionCreate:()=>Cl,CategoricalFeedbackDefinitionPublic:()=>Yo,CategoricalFeedbackDefinitionUpdate:()=>Ul,CategoricalFeedbackDetail:()=>vl,CategoricalFeedbackDetailCreate:()=>El,CategoricalFeedbackDetailPublic:()=>Il,CategoricalFeedbackDetailUpdate:()=>Dl,ChatCompletionChoice:()=>Nl,ChatCompletionRequest:()=>bt,ChatCompletionResponse:()=>Vl,Check:()=>Jl,CheckName:()=>Ll,CheckPublic:()=>$l,CheckPublicName:()=>Gl,CheckPublicResult:()=>Kl,CheckResult:()=>Hl,ChunkedOutputJsonNode:()=>tx,ChunkedOutputJsonNodePublic:()=>ox,ChunkedOutputJsonNodePublicType:()=>Yl,ChunkedOutputJsonNodeType:()=>Ql,Column:()=>Zl,ColumnCompare:()=>ql,ColumnCompareTypesItem:()=>Ol,ColumnPublic:()=>rm,ColumnPublicTypesItem:()=>em,ColumnTypesItem:()=>Xl,Comment:()=>O,CommentCompare:()=>tm,CommentPublic:()=>yr,CompleteMultipartUploadRequest:()=>Ja,CompleteMultipartUploadRequestEntityType:()=>om,CompletionTokensDetails:()=>Ml,CountValueStatPublic:()=>am,CreateDatasetItemsFromSpansRequest:()=>wt,CreateDatasetItemsFromTracesRequest:()=>_t,CreatePromptVersionDetail:()=>oo,CreatePromptVersionDetailTemplateStructure:()=>Ea,DashboardPagePublic:()=>nm,DashboardPublic:()=>br,DashboardUpdatePublic:()=>Rt,DashboardWrite:()=>xt,DataPointDouble:()=>ix,DataPointNumberPublic:()=>sm,Dataset:()=>ax,DatasetExpansion:()=>nx,DatasetExpansionResponse:()=>mm,DatasetExpansionWrite:()=>zt,DatasetExportJobPublic:()=>Ir,DatasetExportJobPublicStatus:()=>Os,DatasetIdentifier:()=>kt,DatasetIdentifierPublic:()=>Pt,DatasetItem:()=>Zo,DatasetItemBatch:()=>sx,DatasetItemBatchUpdate:()=>At,DatasetItemBatchWrite:()=>vt,DatasetItemChangesPublic:()=>dm,DatasetItemCompare:()=>xm,DatasetItemCompareSource:()=>um,DatasetItemFilter:()=>St,DatasetItemFilterOperator:()=>Ys,DatasetItemPageCompare:()=>wm,DatasetItemPagePublic:()=>km,DatasetItemPublic:()=>qo,DatasetItemPublicSource:()=>_m,DatasetItemSource:()=>lm,DatasetItemStreamRequest:()=>jt,DatasetItemUpdate:()=>Xs,DatasetItemWrite:()=>Tt,DatasetItemWriteSource:()=>Zs,DatasetItemsDelete:()=>Et,DatasetPagePublic:()=>Am,DatasetPublic:()=>Jr,DatasetPublicStatus:()=>Pm,DatasetPublicVisibility:()=>Sm,DatasetStatus:()=>pm,DatasetUpdate:()=>Ct,DatasetUpdateVisibility:()=>ma,DatasetVersionDiff:()=>vm,DatasetVersionDiffStats:()=>Tm,DatasetVersionPagePublic:()=>jm,DatasetVersionPublic:()=>Je,DatasetVersionRestorePublic:()=>It,DatasetVersionRetrieveRequestPublic:()=>Dt,DatasetVersionSummary:()=>Xo,DatasetVersionSummaryPublic:()=>ei,DatasetVersionTag:()=>Ut,DatasetVersionUpdatePublic:()=>Ft,DatasetVisibility:()=>cm,DatasetWrite:()=>Nt,DatasetWriteVisibility:()=>da,DeleteAttachmentsRequest:()=>px,DeleteAttachmentsRequestEntityType:()=>Em,DeleteFeedbackScore:()=>ri,DeleteIdsHolder:()=>Gr,DeleteThreadFeedbackScores:()=>ho,DeleteTraceThreads:()=>go,Delta:()=>Fl,DownloadAttachmentRequestEntityType:()=>sa,ErrorCountWithDeviation:()=>ti,ErrorCountWithDeviationDetailed:()=>Cm,ErrorInfo:()=>Ne,ErrorInfoExperimentItemBulkWriteView:()=>Vt,ErrorInfoPublic:()=>oi,ErrorInfoWrite:()=>lo,ErrorMessage:()=>ae,ErrorMessageDetail:()=>cx,ErrorMessageDetailed:()=>lx,ErrorMessagePublic:()=>mx,Experiment:()=>dx,ExperimentBatchUpdate:()=>Bt,ExperimentGroupAggregationsResponse:()=>Fm,ExperimentGroupResponse:()=>Bm,ExperimentItem:()=>Jt,ExperimentItemBulkRecord:()=>Gm,ExperimentItemBulkRecordExperimentItemBulkWriteView:()=>pp,ExperimentItemBulkUpload:()=>ux,ExperimentItemBulkUploadExperimentItemBulkWriteView:()=>Lt,ExperimentItemCompare:()=>Rm,ExperimentItemCompareTraceVisibilityMode:()=>fm,ExperimentItemPublic:()=>Oo,ExperimentItemPublicTraceVisibilityMode:()=>zm,ExperimentItemReference:()=>Lm,ExperimentItemReferencePublic:()=>Km,ExperimentItemStreamRequest:()=>Ht,ExperimentItemTraceVisibilityMode:()=>cp,ExperimentItemsBatch:()=>Gt,ExperimentItemsDelete:()=>Kt,ExperimentPagePublic:()=>Xm,ExperimentPublic:()=>si,ExperimentPublicStatus:()=>$m,ExperimentPublicType:()=>Qm,ExperimentScore:()=>Mt,ExperimentScorePublic:()=>Ym,ExperimentScoreWrite:()=>up,ExperimentStatus:()=>Im,ExperimentStreamRequestPublic:()=>$t,ExperimentType:()=>Dm,ExperimentUpdate:()=>Wt,ExperimentUpdateStatus:()=>qs,ExperimentUpdateType:()=>ep,ExperimentWrite:()=>Qt,ExperimentWriteStatus:()=>ha,ExperimentWriteType:()=>ga,ExportTraceServiceRequest:()=>fx,Feedback:()=>hx,FeedbackCreate:()=>od,FeedbackDefinitionPagePublic:()=>sd,FeedbackObjectPublic:()=>nd,FeedbackPublic:()=>cd,FeedbackScore:()=>pe,FeedbackScoreAverage:()=>de,FeedbackScoreAverageDetailed:()=>ld,FeedbackScoreAveragePublic:()=>sr,FeedbackScoreBatch:()=>ci,FeedbackScoreBatchItem:()=>dd,FeedbackScoreBatchItemSource:()=>md,FeedbackScoreBatchItemThread:()=>jp,FeedbackScoreBatchItemThreadSource:()=>vp,FeedbackScoreBatchThread:()=>yo,FeedbackScoreCompare:()=>bm,FeedbackScoreCompareSource:()=>hm,FeedbackScoreExperimentItemBulkWriteView:()=>ip,FeedbackScoreExperimentItemBulkWriteViewSource:()=>rp,FeedbackScoreNames:()=>fd,FeedbackScorePublic:()=>Kr,FeedbackScorePublicSource:()=>hd,FeedbackScoreSource:()=>lp,FeedbackUpdate:()=>wd,FindFeedbackDefinitionsRequestType:()=>ba,FindFeedbackScoreNames1RequestType:()=>Na,Function:()=>yt,FunctionCall:()=>De,GetSpanStatsRequestType:()=>Ma,GetSpansByProjectRequestType:()=>Wa,GetWebhookExamplesRequestAlertType:()=>ra,GroupContent:()=>Nm,GroupContentWithAggregations:()=>Um,GroupDetail:()=>Mm,GroupDetails:()=>Wm,Guardrail:()=>kd,GuardrailBatch:()=>gx,GuardrailBatchWrite:()=>Yt,GuardrailName:()=>_d,GuardrailResult:()=>zd,GuardrailWrite:()=>gp,GuardrailWriteName:()=>fp,GuardrailWriteResult:()=>hp,GuardrailsValidation:()=>Hm,GuardrailsValidationPublic:()=>Pd,IdsHolder:()=>yx,ImageUrl:()=>fc,ImageUrlPublic:()=>Tc,ImageUrlWrite:()=>Dc,JsonListString:()=>K,JsonListStringCompare:()=>Ga,JsonListStringExperimentItemBulkWriteView:()=>Ae,JsonListStringPublic:()=>ye,JsonListStringWrite:()=>ge,JsonNode:()=>V,JsonNodeDetail:()=>zp,JsonNodePublic:()=>ce,JsonNodeWrite:()=>he,JsonSchema:()=>Vs,LlmAsJudgeCode:()=>Co,LlmAsJudgeCodePublic:()=>Ic,LlmAsJudgeCodeWrite:()=>Wc,LlmAsJudgeMessage:()=>pr,LlmAsJudgeMessageContent:()=>gc,LlmAsJudgeMessageContentPublic:()=>jc,LlmAsJudgeMessageContentWrite:()=>Fc,LlmAsJudgeMessagePublic:()=>mr,LlmAsJudgeMessagePublicRole:()=>Ec,LlmAsJudgeMessageRole:()=>yc,LlmAsJudgeMessageWrite:()=>fr,LlmAsJudgeMessageWriteRole:()=>Nc,LlmAsJudgeModelParameters:()=>cr,LlmAsJudgeModelParametersPublic:()=>dr,LlmAsJudgeModelParametersWrite:()=>hr,LlmAsJudgeOutputSchema:()=>lr,LlmAsJudgeOutputSchemaPublic:()=>ur,LlmAsJudgeOutputSchemaPublicType:()=>Cc,LlmAsJudgeOutputSchemaType:()=>bc,LlmAsJudgeOutputSchemaWrite:()=>gr,LlmAsJudgeOutputSchemaWriteType:()=>Mc,LogItem:()=>Ad,LogItemLevel:()=>Sd,LogPage:()=>Td,ManualEvaluationRequest:()=>li,ManualEvaluationRequestEntityType:()=>vd,ManualEvaluationResponse:()=>mi,Message:()=>Bs,MultipartUploadPart:()=>im,NumericalFeedbackDefinition:()=>Om,NumericalFeedbackDefinitionCreate:()=>rd,NumericalFeedbackDefinitionPublic:()=>pi,NumericalFeedbackDefinitionUpdate:()=>Rd,NumericalFeedbackDetail:()=>Zm,NumericalFeedbackDetailCreate:()=>ed,NumericalFeedbackDetailPublic:()=>id,NumericalFeedbackDetailUpdate:()=>bd,OllamaConnectionTestResponse:()=>Qa,OllamaInstanceBaseUrlRequest:()=>Ya,OllamaModel:()=>yp,Optimization:()=>bx,OptimizationPagePublic:()=>Kd,OptimizationPublic:()=>di,OptimizationPublicStatus:()=>Md,OptimizationStatus:()=>jd,OptimizationStudioConfig:()=>Nd,OptimizationStudioConfigPublic:()=>Gd,OptimizationStudioConfigWrite:()=>qd,OptimizationStudioLog:()=>eu,OptimizationUpdate:()=>Ot,OptimizationUpdateStatus:()=>ka,OptimizationWrite:()=>Xa,OptimizationWriteStatus:()=>ru,PageColumns:()=>tu,PercentageValueStatPublic:()=>ou,PercentageValues:()=>Me,PercentageValuesDetailed:()=>iu,PercentageValuesPublic:()=>ni,Project:()=>Rx,ProjectDetailed:()=>su,ProjectDetailedVisibility:()=>nu,ProjectMetricRequestPublic:()=>qt,ProjectMetricRequestPublicInterval:()=>Sa,ProjectMetricRequestPublicMetricType:()=>Aa,ProjectMetricResponsePublic:()=>mu,ProjectMetricResponsePublicInterval:()=>pu,ProjectMetricResponsePublicMetricType:()=>cu,ProjectPagePublic:()=>uu,ProjectPublic:()=>ui,ProjectPublicVisibility:()=>du,ProjectReference:()=>Ac,ProjectReferencePublic:()=>Go,ProjectRetrieveDetailed:()=>eo,ProjectStatItemObjectPublic:()=>hu,ProjectStatsPublic:()=>Ge,ProjectStatsSummary:()=>yu,ProjectStatsSummaryItem:()=>gu,ProjectUpdate:()=>ro,ProjectUpdateVisibility:()=>Ta,ProjectVisibility:()=>au,ProjectWrite:()=>to,ProjectWriteVisibility:()=>va,Prompt:()=>xx,PromptDetail:()=>ku,PromptDetailTemplateStructure:()=>zu,PromptPagePublic:()=>Au,PromptPublic:()=>Su,PromptPublicTemplateStructure:()=>Pu,PromptTemplateStructure:()=>bu,PromptTokensDetails:()=>Wl,PromptType:()=>Ru,PromptUpdatable:()=>io,PromptVersion:()=>_u,PromptVersionBatchUpdate:()=>ao,PromptVersionDetail:()=>Ee,PromptVersionDetailTemplateStructure:()=>kp,PromptVersionDetailType:()=>Pp,PromptVersionLink:()=>Ka,PromptVersionLinkPublic:()=>$a,PromptVersionLinkWrite:()=>fa,PromptVersionPagePublic:()=>Eu,PromptVersionPublic:()=>ju,PromptVersionPublicTemplateStructure:()=>Tu,PromptVersionPublicType:()=>vu,PromptVersionRetrieveDetail:()=>no,PromptVersionTemplateStructure:()=>xu,PromptVersionType:()=>wu,PromptVersionUpdate:()=>Sp,PromptWrite:()=>so,PromptWriteTemplateStructure:()=>Ca,PromptWriteType:()=>Ia,ProviderApiKey:()=>wx,ProviderApiKeyPagePublic:()=>Du,ProviderApiKeyProvider:()=>Cu,ProviderApiKeyPublic:()=>fi,ProviderApiKeyPublicProvider:()=>Iu,ProviderApiKeyUpdate:()=>Xt,ProviderApiKeyWrite:()=>Zt,ProviderApiKeyWriteProvider:()=>wa,ResponseFormat:()=>Hs,ResponseFormatType:()=>Ls,Result:()=>Rr,ResultsNumberPublic:()=>lu,ScoreName:()=>ud,ServiceTogglesConfig:()=>Uu,Span:()=>ii,SpanBatch:()=>_x,SpanBatchUpdate:()=>co,SpanBatchWrite:()=>uo,SpanEnrichmentOptions:()=>$s,SpanExperimentItemBulkWriteView:()=>np,SpanExperimentItemBulkWriteViewType:()=>ap,SpanFilter:()=>Be,SpanFilterOperator:()=>wc,SpanFilterPublic:()=>Ue,SpanFilterPublicOperator:()=>xp,SpanFilterWrite:()=>Ko,SpanFilterWriteOperator:()=>Oc,SpanLlmAsJudgeCode:()=>Io,SpanLlmAsJudgeCodePublic:()=>Hc,SpanLlmAsJudgeCodeWrite:()=>qc,SpanPagePublic:()=>Nu,SpanPublic:()=>hi,SpanPublicType:()=>Fu,SpanSearchStreamRequestPublic:()=>fo,SpanSearchStreamRequestPublicType:()=>Ua,SpanType:()=>Vm,SpanUpdate:()=>po,SpanUpdateType:()=>Ap,SpanUserDefinedMetricPythonCode:()=>Do,SpanUserDefinedMetricPythonCodePublic:()=>Jc,SpanUserDefinedMetricPythonCodeWrite:()=>rl,SpanWrite:()=>mo,SpanWriteType:()=>Tp,SpansCountResponse:()=>Wu,StartMultipartUploadRequest:()=>gt,StartMultipartUploadRequestEntityType:()=>ia,StartMultipartUploadResponse:()=>Bu,StreamOptions:()=>Js,StudioEvaluation:()=>Cd,StudioEvaluationPublic:()=>Bd,StudioEvaluationWrite:()=>Qd,StudioLlmModel:()=>Id,StudioLlmModelPublic:()=>Vd,StudioLlmModelWrite:()=>Yd,StudioMessage:()=>Ud,StudioMessagePublic:()=>Hd,StudioMessageWrite:()=>Zd,StudioMetric:()=>Ed,StudioMetricPublic:()=>Wd,StudioMetricWrite:()=>$d,StudioOptimizer:()=>Dd,StudioOptimizerPublic:()=>Ld,StudioOptimizerWrite:()=>Xd,StudioPrompt:()=>Fd,StudioPromptPublic:()=>Jd,StudioPromptWrite:()=>Od,TokenUsageNames:()=>Vu,Tool:()=>Ks,ToolCall:()=>Eo,ToolCallType:()=>ac,ToolType:()=>Gs,Trace:()=>ai,TraceBatch:()=>zx,TraceBatchUpdate:()=>Ro,TraceBatchWrite:()=>wo,TraceCountResponse:()=>Hu,TraceEnrichmentOptions:()=>Qs,TraceExperimentItemBulkWriteView:()=>sp,TraceFilter:()=>We,TraceFilterOperator:()=>Rc,TraceFilterPublic:()=>Fe,TraceFilterPublicOperator:()=>wp,TraceFilterWrite:()=>Wo,TraceFilterWriteOperator:()=>Bc,TracePagePublic:()=>Gu,TracePublic:()=>gi,TracePublicVisibilityMode:()=>Ju,TraceSearchStreamRequestPublic:()=>_o,TraceThread:()=>yi,TraceThreadBatchIdentifier:()=>zo,TraceThreadBatchUpdate:()=>Po,TraceThreadFilter:()=>Te,TraceThreadFilterOperator:()=>Ep,TraceThreadFilterPublic:()=>ar,TraceThreadFilterPublicOperator:()=>_p,TraceThreadFilterWrite:()=>$o,TraceThreadFilterWriteOperator:()=>ol,TraceThreadIdentifier:()=>Za,TraceThreadLlmAsJudgeCode:()=>Uo,TraceThreadLlmAsJudgeCodePublic:()=>Gc,TraceThreadLlmAsJudgeCodeWrite:()=>il,TraceThreadPage:()=>$u,TraceThreadSearchStreamRequest:()=>So,TraceThreadStatus:()=>Ku,TraceThreadUpdate:()=>ko,TraceThreadUserDefinedMetricPythonCode:()=>Fo,TraceThreadUserDefinedMetricPythonCodePublic:()=>Kc,TraceThreadUserDefinedMetricPythonCodeWrite:()=>nl,TraceUpdate:()=>bo,TraceVisibilityMode:()=>Jm,TraceWrite:()=>xo,UploadAttachmentRequestEntityType:()=>pa,Usage:()=>Bl,UserDefinedMetricPythonCode:()=>No,UserDefinedMetricPythonCodePublic:()=>$c,UserDefinedMetricPythonCodeWrite:()=>gl,ValueEntry:()=>dp,ValueEntryCompare:()=>ym,ValueEntryCompareSource:()=>gm,ValueEntryExperimentItemBulkWriteView:()=>op,ValueEntryExperimentItemBulkWriteViewSource:()=>tp,ValueEntryPublic:()=>yd,ValueEntryPublicSource:()=>gd,ValueEntrySource:()=>mp,VideoUrl:()=>hc,VideoUrlPublic:()=>vc,VideoUrlWrite:()=>Uc,Webhook:()=>Mp,WebhookExamples:()=>Qu,WebhookPublic:()=>Jp,WebhookTestResult:()=>Xu,WebhookTestResultStatus:()=>Yu,WebhookWrite:()=>Zp,WelcomeWizardSubmission:()=>Ao,WelcomeWizardTracking:()=>Zu,WorkspaceConfiguration:()=>bi,WorkspaceMetricRequest:()=>kx,WorkspaceMetricResponse:()=>Oa,WorkspaceMetricsSummaryRequest:()=>$r,WorkspaceMetricsSummaryResponse:()=>Ou,WorkspaceNameHolder:()=>qu,WorkspaceSpansCount:()=>Mu,WorkspaceTraceCount:()=>Lu,alerts:()=>ta,annotationQueues:()=>oa,attachments:()=>Cr,chatCompletions:()=>ca,dashboards:()=>la,datasets:()=>Dr,experiments:()=>Ur,feedbackDefinitions:()=>Ra,guardrails:()=>xa,llmProviderKey:()=>_a,ollama:()=>Fr,optimizations:()=>Pa,projects:()=>ja,prompts:()=>Da,spans:()=>Nr,traces:()=>nr,welcomeWizard:()=>La});var ta={};W(ta,{GetWebhookExamplesRequestAlertType:()=>ra});var ra=r.enum_(["general","slack","pagerduty"]);var Ws=r.enum_(["trace","thread"]);var ut=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:Ws,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional())});var ft=r.object({annotationQueues:r.property("annotation_queues",r.list(ut))});var ht=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 oa={};W(oa,{AnnotationQueueBatchWrite:()=>ft,AnnotationQueueUpdate:()=>ht});var ia=r.enum_(["trace","span"]);var gt=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",ia),entityId:r.property("entity_id",r.string()),path:r.string()});var Cr={};W(Cr,{AttachmentListRequestEntityType:()=>na,DownloadAttachmentRequestEntityType:()=>sa,StartMultipartUploadRequest:()=>gt,StartMultipartUploadRequestEntityType:()=>ia,UploadAttachmentRequestEntityType:()=>pa,uploadAttachment:()=>aa});var aa={};W(aa,{Request:()=>GR});var GR=r.record(r.string(),r.unknown());var na=r.enum_(["trace","span"]);var sa=r.enum_(["trace","span"]);var pa=r.enum_(["trace","span"]);var yt=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 Bs=r.record(r.string(),r.unknown());var Vs=r.object({name:r.string().optional(),strict:r.boolean().optional(),schema:r.record(r.string(),r.record(r.string(),r.unknown())).optional()});var Ls=r.enum_(["text","json_object","json_schema"]);var Hs=r.object({type:Ls.optional(),jsonSchema:r.property("json_schema",Vs.optional())});var Js=r.object({includeUsage:r.property("include_usage",r.boolean().optional())});var Gs=r.enum_(["function"]);var Ks=r.object({type:Gs.optional(),function:yt.optional()});var bt=r.object({model:r.string().optional(),messages:r.list(Bs).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",Js.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",Hs.optional()),seed:r.number().optional(),tools:r.list(Ks).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(yt).optional(),functionCall:r.property("function_call",De.optional())});var ca={};W(ca,{ChatCompletionRequest:()=>bt});var ce=r.record(r.string(),r.unknown());var Rt=r.object({name:r.string().optional(),description:r.string().optional(),config:ce.optional()});var he=r.record(r.string(),r.unknown());var xt=r.object({name:r.string(),description:r.string().optional(),config:he});var la={};W(la,{DashboardUpdatePublic:()=>Rt,DashboardWrite:()=>xt});var $s=r.object({includeTags:r.boolean().optional(),includeFeedbackScores:r.boolean().optional(),includeComments:r.boolean().optional(),includeUsage:r.boolean().optional(),includeMetadata:r.boolean().optional()});var wt=r.object({spanIds:r.property("span_ids",r.list(r.string())),enrichmentOptions:r.property("enrichment_options",$s)});var Qs=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 _t=r.object({traceIds:r.property("trace_ids",r.list(r.string())),enrichmentOptions:r.property("enrichment_options",Qs)});var zt=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 kt=r.object({datasetName:r.property("dataset_name",r.string())});var Pt=r.object({datasetName:r.property("dataset_name",r.string())});var Ys=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var St=r.object({field:r.string().optional(),operator:Ys.optional(),key:r.string().optional(),value:r.string().optional()});var V=r.record(r.string(),r.unknown());var Xs=r.object({input:r.string().optional(),expectedOutput:r.property("expected_output",r.string().optional()),metadata:V.optional(),data:V.optional(),tags:r.list(r.string()).optional()});var At=r.object({ids:r.list(r.string()).optional(),filters:r.list(St).optional(),datasetId:r.property("dataset_id",r.string().optional()),update:Xs,mergeTags:r.property("merge_tags",r.boolean().optional())});var Zs=r.enum_(["manual","trace","span","sdk"]);var Tt=r.object({id:r.string().optional(),traceId:r.property("trace_id",r.string().optional()),spanId:r.property("span_id",r.string().optional()),source:Zs,data:V,tags:r.list(r.string()).optional()});var vt=r.object({datasetName:r.property("dataset_name",r.string().optional()),datasetId:r.property("dataset_id",r.string().optional()),items:r.list(Tt),batchGroupId:r.property("batch_group_id",r.string().optional())});var jt=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()),filters:r.string().optional()});var Et=r.object({itemIds:r.property("item_ids",r.list(r.string()).optional()),datasetId:r.property("dataset_id",r.string().optional()),filters:r.list(St).optional(),batchGroupId:r.property("batch_group_id",r.string().optional())});var ma=r.enum_(["private","public"]);var Ct=r.object({name:r.string(),description:r.string().optional(),visibility:ma.optional(),tags:r.list(r.string()).optional()});var It=r.object({versionRef:r.property("version_ref",r.string())});var Dt=r.object({versionName:r.property("version_name",r.string())});var Ut=r.object({tag:r.string()});var Ft=r.object({changeDescription:r.property("change_description",r.string().optional()),tagsToAdd:r.property("tags_to_add",r.list(r.string()).optional())});var da=r.enum_(["private","public"]);var Nt=r.object({id:r.string().optional(),name:r.string(),visibility:da.optional(),tags:r.list(r.string()).optional(),description:r.string().optional()});var Dr={};W(Dr,{CreateDatasetItemsFromSpansRequest:()=>wt,CreateDatasetItemsFromTracesRequest:()=>_t,DatasetExpansionWrite:()=>zt,DatasetIdentifier:()=>kt,DatasetIdentifierPublic:()=>Pt,DatasetItemBatchUpdate:()=>At,DatasetItemBatchWrite:()=>vt,DatasetItemStreamRequest:()=>jt,DatasetItemsDelete:()=>Et,DatasetUpdate:()=>Ct,DatasetUpdateVisibility:()=>ma,DatasetVersionRestorePublic:()=>It,DatasetVersionRetrieveRequestPublic:()=>Dt,DatasetVersionTag:()=>Ut,DatasetVersionUpdatePublic:()=>Ft,DatasetWrite:()=>Nt,DatasetWriteVisibility:()=>da,getDatasetExportJobs:()=>ua});var ua={};W(ua,{Response:()=>KR});var Os=r.enum_(["PENDING","PROCESSING","COMPLETED","FAILED"]);var Ir=r.object({id:r.string().optional(),datasetId:r.property("dataset_id",r.string().optional()),datasetName:r.property("dataset_name",r.string().optional()),status:Os.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 KR=r.list(Ir);var Mt=r.object({name:r.string(),value:r.number()});var qs=r.enum_(["running","completed","cancelled"]);var ep=r.enum_(["regular","trial","mini-batch"]);var Wt=r.object({name:r.string().optional(),metadata:V.optional(),tags:r.list(r.string()).optional(),type:ep.optional(),status:qs.optional(),experimentScores:r.property("experiment_scores",r.list(Mt).optional())});var Bt=r.object({ids:r.list(r.string()),update:Wt,mergeTags:r.property("merge_tags",r.boolean().optional())});var rp=r.enum_(["ui","sdk","online_scoring"]);var tp=r.enum_(["ui","sdk","online_scoring"]);var op=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:tp.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 ip=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:rp,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(),op).optional())});var Ae=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Vt=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var ap=r.enum_(["general","tool","llm","guardrail"]);var np=r.object({id:r.string().optional(),parentSpanId:r.property("parent_span_id",r.string().optional()),name:r.string().optional(),type:ap.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",Vt.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 sp=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",Vt.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),threadId:r.property("thread_id",r.string().optional())});var pp=r.object({datasetItemId:r.property("dataset_item_id",r.string()),evaluateTaskResult:r.property("evaluate_task_result",Ae.optional()),trace:sp.optional(),spans:r.list(np).optional(),feedbackScores:r.property("feedback_scores",r.list(ip).optional())});var Lt=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(pp)});var Ht=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 cp=r.enum_(["default","hidden"]);var lp=r.enum_(["ui","sdk","online_scoring"]);var mp=r.enum_(["ui","sdk","online_scoring"]);var dp=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:mp.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 pe=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:lp,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(),dp).optional())});var K=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Jt=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(pe).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",cp.optional())});var Gt=r.object({experimentItems:r.property("experiment_items",r.list(Jt))});var Kt=r.object({ids:r.list(r.string())});var $t=r.object({name:r.string(),limit:r.number().optional(),lastRetrievedId:r.property("last_retrieved_id",r.string().optional())});var up=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 fa=r.object({id:r.string()});var ha=r.enum_(["running","completed","cancelled"]);var ga=r.enum_(["regular","trial","mini-batch"]);var Qt=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:ga.optional(),optimizationId:r.property("optimization_id",r.string().optional()),status:ha.optional(),experimentScores:r.property("experiment_scores",r.list(up).optional()),promptVersion:r.property("prompt_version",fa.optional()),promptVersions:r.property("prompt_versions",r.list(fa).optional()),datasetVersionId:r.property("dataset_version_id",r.string().optional())});var Ur={};W(Ur,{ExperimentBatchUpdate:()=>Bt,ExperimentItemBulkUploadExperimentItemBulkWriteView:()=>Lt,ExperimentItemStreamRequest:()=>Ht,ExperimentItemsBatch:()=>Gt,ExperimentItemsDelete:()=>Kt,ExperimentStreamRequestPublic:()=>$t,ExperimentWrite:()=>Qt,ExperimentWriteStatus:()=>ha,ExperimentWriteType:()=>ga,findFeedbackScoreNames:()=>ya});var ya={};W(ya,{Response:()=>$R});var $R=r.list(r.string());var Ra={};W(Ra,{FindFeedbackDefinitionsRequestType:()=>ba});var ba=r.enum_(["numerical","categorical","boolean"]);var fp=r.enum_(["TOPIC","PII"]);var hp=r.enum_(["passed","failed"]);var gp=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:fp,result:hp,config:V,details:V});var Yt=r.object({guardrails:r.list(gp)});var xa={};W(xa,{GuardrailBatchWrite:()=>Yt});var Xt=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 wa=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","bedrock","ollama","custom-llm","opik-free"]);var Zt=r.object({provider:wa,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 _a={};W(_a,{ProviderApiKeyUpdate:()=>Xt,ProviderApiKeyWrite:()=>Zt,ProviderApiKeyWriteProvider:()=>wa});var Fr={};W(Fr,{listModels:()=>za});var za={};W(za,{Response:()=>QR});var yp=r.object({name:r.string(),size:r.number().optional(),digest:r.string().optional(),modifiedAt:r.property("modified_at",r.date().optional())});var QR=r.list(yp);var ka=r.enum_(["running","completed","cancelled","initialized","error"]);var Ot=r.object({name:r.string().optional(),status:ka.optional()});var Pa={};W(Pa,{OptimizationUpdate:()=>Ot,OptimizationUpdateStatus:()=>ka});var bp=r.enum_(["none","tags","metadata","name","error_info","model","provider","type"]);var Rp=r.object({field:bp.optional(),metadataKey:r.property("metadata_key",r.string().optional()),subMetric:r.property("sub_metric",r.string().optional())});var xp=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Ue=r.object({field:r.string().optional(),operator:xp.optional(),key:r.string().optional(),value:r.string().optional()});var wp=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Fe=r.object({field:r.string().optional(),operator:wp.optional(),key:r.string().optional(),value:r.string().optional()});var _p=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var ar=r.object({field:r.string().optional(),operator:_p.optional(),key:r.string().optional(),value:r.string().optional()});var Sa=r.enum_(["HOURLY","DAILY","WEEKLY"]);var Aa=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",Aa.optional()),interval:Sa.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(ar).optional()),breakdown:Rp.optional()});var eo=r.object({name:r.string()});var Ta=r.enum_(["private","public"]);var ro=r.object({name:r.string().optional(),description:r.string().optional(),visibility:Ta.optional()});var va=r.enum_(["private","public"]);var to=r.object({name:r.string(),visibility:va.optional(),description:r.string().optional()});var ja={};W(ja,{ProjectMetricRequestPublic:()=>qt,ProjectMetricRequestPublicInterval:()=>Sa,ProjectMetricRequestPublicMetricType:()=>Aa,ProjectRetrieveDetailed:()=>eo,ProjectUpdate:()=>ro,ProjectUpdateVisibility:()=>Ta,ProjectWrite:()=>to,ProjectWriteVisibility:()=>va});var zp=r.record(r.string(),r.unknown());var kp=r.enum_(["text","chat"]);var Pp=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:zp.optional(),type:Pp.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",kp.optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Ea=r.enum_(["text","chat"]);var oo=r.object({name:r.string(),version:Ee,templateStructure:r.property("template_structure",Ea.optional())});var io=r.object({name:r.string(),description:r.string().optional(),tags:r.list(r.string()).optional()});var Sp=r.object({tags:r.list(r.string()).optional()});var ao=r.object({ids:r.list(r.string()),update:Sp,mergeTags:r.property("merge_tags",r.boolean().optional())});var no=r.object({name:r.string(),commit:r.string().optional()});var Ca=r.enum_(["text","chat"]);var Ia=r.enum_(["mustache","jinja2"]);var so=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:Ia.optional(),templateStructure:r.property("template_structure",Ca.optional()),tags:r.list(r.string()).optional()});var Da={};W(Da,{CreatePromptVersionDetail:()=>oo,CreatePromptVersionDetailTemplateStructure:()=>Ea,PromptUpdatable:()=>io,PromptVersionBatchUpdate:()=>ao,PromptVersionRetrieveDetail:()=>no,PromptWrite:()=>so,PromptWriteTemplateStructure:()=>Ca,PromptWriteType:()=>Ia});var Ne=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var Ap=r.enum_(["general","tool","llm","guardrail"]);var po=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:Ap.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 co=r.object({ids:r.list(r.string()),update:po,mergeTags:r.property("merge_tags",r.boolean().optional())});var lo=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var Tp=r.enum_(["general","tool","llm","guardrail"]);var mo=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:Tp.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",lo.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 uo=r.object({spans:r.list(mo)});var Ua=r.enum_(["general","tool","llm","guardrail"]);var fo=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:Ua.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 Nr={};W(Nr,{FindFeedbackScoreNames1RequestType:()=>Na,GetSpanStatsRequestType:()=>Ma,GetSpansByProjectRequestType:()=>Wa,SpanBatchUpdate:()=>co,SpanBatchWrite:()=>uo,SpanSearchStreamRequestPublic:()=>fo,SpanSearchStreamRequestPublicType:()=>Ua,findFeedbackScoreNames1:()=>Fa});var Fa={};W(Fa,{Response:()=>YR});var YR=r.list(r.string());var Na=r.enum_(["general","tool","llm","guardrail"]);var Ma=r.enum_(["general","tool","llm","guardrail"]);var Wa=r.enum_(["general","tool","llm","guardrail"]);var ho=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 go=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 vp=r.enum_(["ui","sdk","online_scoring"]);var jp=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:vp,author:r.string().optional(),threadId:r.property("thread_id",r.string())});var yo=r.object({scores:r.list(jp)});var bo=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 Ro=r.object({ids:r.list(r.string()),update:bo,mergeTags:r.property("merge_tags",r.boolean().optional())});var xo=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",lo.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),threadId:r.property("thread_id",r.string().optional())});var wo=r.object({traces:r.list(xo)});var _o=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 zo=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 ko=r.object({tags:r.list(r.string()).optional()});var Po=r.object({ids:r.list(r.string()),update:ko,mergeTags:r.property("merge_tags",r.boolean().optional())});var Ep=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Te=r.object({field:r.string().optional(),operator:Ep.optional(),key:r.string().optional(),value:r.string().optional()});var So=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 nr={};W(nr,{DeleteThreadFeedbackScores:()=>ho,DeleteTraceThreads:()=>go,FeedbackScoreBatchThread:()=>yo,TraceBatchUpdate:()=>Ro,TraceBatchWrite:()=>wo,TraceSearchStreamRequestPublic:()=>_o,TraceThreadBatchIdentifier:()=>zo,TraceThreadBatchUpdate:()=>Po,TraceThreadSearchStreamRequest:()=>So,findFeedbackScoreNames2:()=>Ba,findTraceThreadsFeedbackScoreNames:()=>Va});var Ba={};W(Ba,{Response:()=>XR});var XR=r.list(r.string());var Va={};W(Va,{Response:()=>ZR});var ZR=r.list(r.string());var Ao=r.object({role:r.string().optional(),integrations:r.list(r.string()).optional(),email:r.string().optional(),joinBetaProgram:r.property("join_beta_program",r.boolean().optional())});var La={};W(La,{WelcomeWizardSubmission:()=>Ao});var de=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 Cp=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(de).optional()),experimentScores:r.property("experiment_scores",r.list(de).optional())});var Ip=r.enum_(["general","slack","pagerduty"]);var Dp=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var Up=r.object({id:r.string().optional(),alertTriggerId:r.property("alert_trigger_id",r.string().optional()),type:Dp,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 Fp=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 Np=r.object({id:r.string().optional(),alertId:r.property("alert_id",r.string().optional()),eventType:r.property("event_type",Fp),triggerConfigs:r.property("trigger_configs",r.list(Up).optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var Mp=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 OR=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",Ip.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:Mp,triggers:r.list(Np).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 Wp=r.enum_(["general","slack","pagerduty"]);var Bp=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var Vp=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 Lp=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 Hp=r.object({id:r.string().optional(),alertId:r.property("alert_id",r.string().optional()),eventType:r.property("event_type",Lp),triggerConfigs:r.property("trigger_configs",r.list(Vp).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 To=r.object({id:r.string().optional(),name:r.string().optional(),enabled:r.boolean().optional(),alertType:r.property("alert_type",Wp.optional()),metadata:r.record(r.string(),r.string()).optional(),webhook:Jp,triggers:r.list(Hp).optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Gp=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(To).optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var Kp=r.enum_(["scope:project","threshold:feedback_score","threshold:cost","threshold:latency","threshold:errors"]);var $p=r.object({id:r.string().optional(),type:Kp,configValue:r.property("config_value",r.record(r.string(),r.string()).optional())});var Qp=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 Yp=r.object({id:r.string().optional(),eventType:r.property("event_type",Qp),triggerConfigs:r.property("trigger_configs",r.list($p).optional())});var Xp=r.enum_(["general","slack","pagerduty"]);var Zp=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 vo=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:Zp,triggers:r.list(Yp).optional()});var Op=r.object({username:r.string().optional(),status:r.number().optional()});var qp=r.enum_(["trace","thread"]);var ec=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:qp,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional()),reviewers:r.list(Op).optional(),feedbackScores:r.property("feedback_scores",r.list(de).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 qR=r.object({annotationQueues:r.property("annotation_queues",r.list(ec))});var Ha=r.object({ids:r.list(r.string())});var rc=r.enum_(["trace","thread"]);var tc=r.object({username:r.string().optional(),status:r.number().optional()});var sr=r.object({name:r.string(),value:r.number()});var jo=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:rc,commentsEnabled:r.property("comments_enabled",r.boolean().optional()),feedbackDefinitionNames:r.property("feedback_definition_names",r.list(r.string()).optional()),reviewers:r.list(tc).optional(),feedbackScores:r.property("feedback_scores",r.list(sr).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 oc=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(jo).optional(),sortableBy:r.list(r.string()).optional()});var ic=r.enum_(["system","user","assistant","tool","function"]);var ac=r.enum_(["function"]);var Eo=r.object({id:r.string().optional(),index:r.number().optional(),type:ac.optional(),function:De.optional()});var nc=r.object({role:ic.optional(),content:r.string().optional(),reasoningContent:r.property("reasoning_content",r.string().optional()),name:r.string().optional(),toolCalls:r.property("tool_calls",r.list(Eo).optional()),refusal:r.string().optional(),functionCall:r.property("function_call",De.optional())});var sc=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 pc=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(sc).optional(),sortableBy:r.list(r.string()).optional()});var cc=r.object({url:r.string()});var lc=r.object({url:r.string()});var mc=r.object({url:r.string()});var dc=r.record(r.string(),r.unknown());var uc=r.enum_(["evaluator"]);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",cc.optional())});var yc=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var pr=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 cr=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",V.optional())});var bc=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var lr=r.object({name:r.string(),type:bc,description:r.string()});var Co=r.object({model:cr,messages:r.list(pr),variables:r.record(r.string(),r.string()),schema:r.list(lr)});var Rc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var We=r.object({field:r.string().optional(),operator:Rc.optional(),key:r.string().optional(),value:r.string().optional()});var xc=r.object({filters:r.list(We).optional(),code:Co.optional()});var wc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Be=r.object({field:r.string().optional(),operator:wc.optional(),key:r.string().optional(),value:r.string().optional()});var Io=r.object({model:cr,messages:r.list(pr),variables:r.record(r.string(),r.string()),schema:r.list(lr)});var _c=r.object({filters:r.list(Be).optional(),code:Io.optional()});var Do=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var zc=r.object({filters:r.list(Be).optional(),code:Do.optional()});var Uo=r.object({model:cr,messages:r.list(pr),schema:r.list(lr)});var kc=r.object({filters:r.list(Te).optional(),code:Uo.optional()});var Fo=r.object({metric:r.string()});var Pc=r.object({filters:r.list(Te).optional(),code:Fo.optional()});var No=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Sc=r.object({filters:r.list(We).optional(),code:No.optional()});var Ac=r.object({projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string())});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(Ac).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:uc}),ex=r.union("type",{llm_as_judge:xc.extend(Mr),user_defined_metric_python:Sc.extend(Mr),trace_thread_llm_as_judge:kc.extend(Mr),trace_thread_user_defined_metric_python:Pc.extend(Mr),span_llm_as_judge:_c.extend(Mr),span_user_defined_metric_python:zc.extend(Mr)}).transform({transform:s=>s,untransform:s=>s});var Tc=r.object({url:r.string(),detail:r.string().optional()});var vc=r.object({url:r.string()});var jc=r.object({type:r.string(),text:r.string().optional(),imageUrl:r.property("image_url",Tc.optional()),videoUrl:r.property("video_url",vc.optional()),audioUrl:r.property("audio_url",lc.optional())});var Ec=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var mr=r.object({role:Ec,content:r.string().optional(),contentArray:r.property("content_array",r.list(jc).optional()),stringContent:r.property("string_content",r.boolean().optional()),structuredContent:r.property("structured_content",r.boolean().optional())});var dr=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",ce.optional())});var Cc=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var ur=r.object({name:r.string(),type:Cc,description:r.string()});var Ic=r.object({model:dr,messages:r.list(mr),variables:r.record(r.string(),r.string()),schema:r.list(ur)});var Mo=r.object({filters:r.list(Fe).optional(),code:Ic.optional()});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",mc.optional())});var Nc=r.enum_(["SYSTEM","USER","AI","TOOL_EXECUTION_RESULT","CUSTOM"]);var fr=r.object({role:Nc,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 hr=r.object({name:r.string(),temperature:r.number(),seed:r.number().optional(),customParameters:r.property("custom_parameters",he.optional())});var Mc=r.enum_(["BOOLEAN","INTEGER","DOUBLE"]);var gr=r.object({name:r.string(),type:Mc,description:r.string()});var Wc=r.object({model:hr,messages:r.list(fr),variables:r.record(r.string(),r.string()),schema:r.list(gr)});var Bc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Wo=r.object({field:r.string().optional(),operator:Bc.optional(),key:r.string().optional(),value:r.string().optional()});var Vc=r.object({filters:r.list(Wo).optional(),code:Wc.optional()});var Lc=r.enum_(["evaluator"]);var Hc=r.object({model:dr,messages:r.list(mr),variables:r.record(r.string(),r.string()),schema:r.list(ur)});var Bo=r.object({filters:r.list(Ue).optional(),code:Hc.optional()});var Jc=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Vo=r.object({filters:r.list(Ue).optional(),code:Jc.optional()});var Gc=r.object({model:dr,messages:r.list(mr),schema:r.list(ur)});var Lo=r.object({filters:r.list(ar).optional(),code:Gc.optional()});var Kc=r.object({metric:r.string()});var Ho=r.object({filters:r.list(ar).optional(),code:Kc.optional()});var $c=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var Jo=r.object({filters:r.list(Fe).optional(),code:$c.optional()});var Go=r.object({projectId:r.property("project_id",r.string()),projectName:r.property("project_name",r.string())});var Wr=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(Go).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:Lc}),Qc=r.union("type",{llm_as_judge:Mo.extend(Wr),user_defined_metric_python:Jo.extend(Wr),trace_thread_llm_as_judge:Lo.extend(Wr),trace_thread_user_defined_metric_python:Ho.extend(Wr),span_llm_as_judge:Bo.extend(Wr),span_user_defined_metric_python:Vo.extend(Wr)}).transform({transform:s=>s,untransform:s=>s});var Yc=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Qc).optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var Xc=r.enum_(["evaluator"]);var Br=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(Go).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:Xc}),Zc=r.union("type",{llm_as_judge:Mo.extend(Br),user_defined_metric_python:Jo.extend(Br),trace_thread_llm_as_judge:Lo.extend(Br),trace_thread_user_defined_metric_python:Ho.extend(Br),span_llm_as_judge:Bo.extend(Br),span_user_defined_metric_python:Vo.extend(Br)}).transform({transform:s=>s,untransform:s=>s});var Oc=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var Ko=r.object({field:r.string().optional(),operator:Oc.optional(),key:r.string().optional(),value:r.string().optional()});var qc=r.object({model:hr,messages:r.list(fr),variables:r.record(r.string(),r.string()),schema:r.list(gr)});var el=r.object({filters:r.list(Ko).optional(),code:qc.optional()});var rl=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var tl=r.object({filters:r.list(Ko).optional(),code:rl.optional()});var ol=r.enum_(["contains","not_contains","starts_with","ends_with","=","!=",">",">=","<","<=","is_empty","is_not_empty"]);var $o=r.object({field:r.string().optional(),operator:ol.optional(),key:r.string().optional(),value:r.string().optional()});var il=r.object({model:hr,messages:r.list(fr),schema:r.list(gr)});var al=r.object({filters:r.list($o).optional(),code:il.optional()});var nl=r.object({metric:r.string()});var sl=r.object({filters:r.list($o).optional(),code:nl.optional()});var pl=r.enum_(["evaluator"]);var cl=r.object({filters:r.list(We).optional(),code:Co.optional()});var ll=r.object({filters:r.list(Be).optional(),code:Io.optional()});var ml=r.object({filters:r.list(Be).optional(),code:Do.optional()});var dl=r.object({filters:r.list(Te).optional(),code:Uo.optional()});var ul=r.object({filters:r.list(Te).optional(),code:Fo.optional()});var fl=r.object({filters:r.list(We).optional(),code:No.optional()});var Vr=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:pl}),hl=r.union("type",{llm_as_judge:cl.extend(Vr),user_defined_metric_python:fl.extend(Vr),trace_thread_llm_as_judge:dl.extend(Vr),trace_thread_user_defined_metric_python:ul.extend(Vr),span_llm_as_judge:ll.extend(Vr),span_user_defined_metric_python:ml.extend(Vr)}).transform({transform:s=>s,untransform:s=>s});var gl=r.object({metric:r.string(),arguments:r.record(r.string(),r.string())});var yl=r.object({filters:r.list(Wo).optional(),code:gl.optional()});var bl=r.enum_(["evaluator"]);var Lr=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:bl}),Rl=r.union("type",{llm_as_judge:Vc.extend(Lr),user_defined_metric_python:yl.extend(Lr),trace_thread_llm_as_judge:al.extend(Lr),trace_thread_user_defined_metric_python:sl.extend(Lr),span_llm_as_judge:el.extend(Lr),span_user_defined_metric_python:tl.extend(Lr)}).transform({transform:s=>s,untransform:s=>s});var xl=r.object({value:r.number().optional()});var X=r.object({ids:r.list(r.string())});var rx=r.object({ids:r.list(r.string()),projectId:r.property("project_id",r.string().optional())});var wl=r.object({workspaceId:r.property("workspace_id",r.string().optional()),user:r.string().optional(),count:r.number().optional()});var Hr=r.object({biInformation:r.property("bi_information",r.list(wl).optional())});var _l=r.object({trueLabel:r.string(),falseLabel:r.string()});var zl=r.object({details:_l.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 kl=r.object({trueLabel:r.string(),falseLabel:r.string()});var Pl=r.object({details:kl.optional()});var Sl=r.object({trueLabel:r.string(),falseLabel:r.string()});var Qo=r.object({details:Sl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var Al=r.object({trueLabel:r.string(),falseLabel:r.string()});var Tl=r.object({details:Al.optional()});var vl=r.object({categories:r.record(r.string(),r.number())});var jl=r.object({details:vl.optional(),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional()),lastUpdatedBy:r.property("last_updated_by",r.string().optional())});var El=r.object({categories:r.record(r.string(),r.number())});var Cl=r.object({details:El.optional()});var Il=r.object({categories:r.record(r.string(),r.number())});var Yo=r.object({details:Il.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 Dl=r.object({categories:r.record(r.string(),r.number())});var Ul=r.object({details:Dl.optional()});var Fl=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(Eo).optional()),functionCall:r.property("function_call",De.optional())});var Nl=r.object({index:r.number().optional(),message:nc.optional(),delta:Fl.optional(),finishReason:r.property("finish_reason",r.string().optional())});var Ml=r.object({reasoningTokens:r.property("reasoning_tokens",r.number().optional())});var Wl=r.object({cachedTokens:r.property("cached_tokens",r.number().optional())});var Bl=r.object({totalTokens:r.property("total_tokens",r.number().optional()),promptTokens:r.property("prompt_tokens",r.number().optional()),promptTokensDetails:r.property("prompt_tokens_details",Wl.optional()),completionTokens:r.property("completion_tokens",r.number().optional()),completionTokensDetails:r.property("completion_tokens_details",Ml.optional())});var Vl=r.object({id:r.string().optional(),created:r.number().optional(),model:r.string().optional(),choices:r.list(Nl).optional(),usage:Bl.optional(),systemFingerprint:r.property("system_fingerprint",r.string().optional()),serviceTier:r.property("service_tier",r.string().optional())});var Ll=r.enum_(["TOPIC","PII"]);var Hl=r.enum_(["passed","failed"]);var Jl=r.object({name:Ll.optional(),result:Hl.optional()});var Gl=r.enum_(["TOPIC","PII"]);var Kl=r.enum_(["passed","failed"]);var $l=r.object({name:Gl.optional(),result:Kl.optional()});var Ql=r.object({typeName:r.string().optional()});var tx=r.object({type:Ql.optional(),closed:r.boolean().optional()});var Yl=r.object({typeName:r.string().optional()});var ox=r.object({type:Yl.optional(),closed:r.boolean().optional()});var Xl=r.enum_(["string","number","object","boolean","array","null"]);var Zl=r.object({name:r.string().optional(),types:r.list(Xl).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var Ol=r.enum_(["string","number","object","boolean","array","null"]);var ql=r.object({name:r.string().optional(),types:r.list(Ol).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var em=r.enum_(["string","number","object","boolean","array","null"]);var rm=r.object({name:r.string().optional(),types:r.list(em).optional(),filterFieldPrefix:r.property("filter_field_prefix",r.string().optional()),filterField:r.string().optional()});var tm=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 yr=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 om=r.enum_(["trace","span"]);var im=r.object({eTag:r.property("e_tag",r.string()),partNumber:r.property("part_number",r.number())});var Ja=r.object({fileName:r.property("file_name",r.string()),projectName:r.property("project_name",r.string().optional()),entityType:r.property("entity_type",om),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(im))});var am=r.object({value:r.number().optional()});var br=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:ce,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 nm=r.object({content:r.list(br).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),sortableBy:r.property("sortable_by",r.list(r.string()).optional())});var ix=r.object({time:r.date(),value:r.number().optional()});var sm=r.object({time:r.date(),value:r.number().optional()});var pm=r.enum_(["unknown","processing","completed","failed"]);var Xo=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 cm=r.enum_(["private","public"]);var ax=r.object({id:r.string().optional(),name:r.string(),visibility:cm.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:pm.optional(),latestVersion:r.property("latest_version",Xo.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 lm=r.enum_(["manual","trace","span","sdk"]);var Zo=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:lm,data:V,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Jt).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 mm=r.object({generatedSamples:r.property("generated_samples",r.list(Zo).optional()),model:r.string().optional(),totalGenerated:r.property("total_generated",r.number().optional()),generationTime:r.property("generation_time",r.date().optional())});var sx=r.object({datasetName:r.property("dataset_name",r.string().optional()),datasetId:r.property("dataset_id",r.string().optional()),items:r.list(Zo),batchGroupId:r.property("batch_group_id",r.string().optional())});var dm=r.record(r.string(),r.unknown());var um=r.enum_(["manual","trace","span","sdk"]);var fm=r.enum_(["default","hidden"]);var hm=r.enum_(["ui","sdk","online_scoring"]);var gm=r.enum_(["ui","sdk","online_scoring"]);var ym=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:gm.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 bm=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:hm,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(),ym).optional())});var Ga=r.undiscriminatedUnion([r.record(r.string(),r.unknown()),r.list(r.record(r.string(),r.unknown())),r.string()]);var Rm=r.object({id:r.string().optional(),experimentId:r.property("experiment_id",r.string()),datasetItemId:r.property("dataset_item_id",r.string()),traceId:r.property("trace_id",r.string()),input:Ga.optional(),output:Ga.optional(),feedbackScores:r.property("feedback_scores",r.list(bm).optional()),comments:r.list(tm).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",fm.optional())});var xm=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:um,data:V,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Rm).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 wm=r.object({content:r.list(xm).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),columns:r.list(ql).optional(),sortableBy:r.list(r.string()).optional()});var _m=r.enum_(["manual","trace","span","sdk"]);var zm=r.enum_(["default","hidden"]);var Oo=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",zm.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:_m,data:V,tags:r.list(r.string()).optional(),experimentItems:r.property("experiment_items",r.list(Oo).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 km=r.object({content:r.list(qo).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),columns:r.list(rm).optional(),sortableBy:r.list(r.string()).optional()});var Pm=r.enum_(["unknown","processing","completed","failed"]);var Sm=r.enum_(["private","public"]);var ei=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 Jr=r.object({id:r.string().optional(),name:r.string(),visibility:Sm.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:Pm.optional(),latestVersion:r.property("latest_version",ei.optional())});var Am=r.object({content:r.list(Jr).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),sortableBy:r.list(r.string()).optional()});var Tm=r.object({itemsAdded:r.number().optional(),itemsModified:r.number().optional(),itemsDeleted:r.number().optional(),itemsUnchanged:r.number().optional()});var vm=r.object({fromVersion:r.property("from_version",r.string().optional()),toVersion:r.property("to_version",r.string().optional()),statistics:Tm.optional()});var Je=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 jm=r.object({content:r.list(Je).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional()});var Em=r.enum_(["trace","span"]);var px=r.object({fileNames:r.property("file_names",r.list(r.string())),entityType:r.property("entity_type",Em),entityId:r.property("entity_id",r.string()),containerId:r.property("container_id",r.string())});var ri=r.object({name:r.string(),author:r.string().optional()});var Gr=r.object({ids:r.list(r.string())});var ti=r.object({count:r.number().optional(),deviation:r.number().optional(),deviationPercentage:r.property("deviation_percentage",r.number().optional())});var Cm=r.object({count:r.number().optional(),deviation:r.number().optional(),deviationPercentage:r.property("deviation_percentage",r.number().optional())});var oi=r.object({exceptionType:r.property("exception_type",r.string()),message:r.string().optional(),traceback:r.string()});var ae=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var cx=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 mx=r.object({code:r.number().optional(),message:r.string().optional(),details:r.string().optional()});var Im=r.enum_(["running","completed","cancelled"]);var Dm=r.enum_(["regular","trial","mini-batch"]);var Ka=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 dx=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()),projectName:r.property("project_name",r.string().optional()),name:r.string().optional(),metadata:K.optional(),tags:r.list(r.string()).optional(),type:Dm.optional(),optimizationId:r.property("optimization_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(de).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:Im.optional(),experimentScores:r.property("experiment_scores",r.list(Mt).optional()),promptVersion:r.property("prompt_version",Ka.optional()),promptVersions:r.property("prompt_versions",r.list(Ka).optional()),datasetVersionId:r.property("dataset_version_id",r.string().optional()),datasetVersionSummary:r.property("dataset_version_summary",Xo.optional())});var Um=r.object({label:r.string().optional(),aggregations:Cp.optional()});var Fm=r.object({content:r.record(r.string(),Um).optional()});var Nm=r.object({label:r.string().optional()});var Mm=r.object({groupSorting:r.property("group_sorting",r.list(r.string()).optional())});var Wm=r.object({groupsDetails:r.property("groups_details",r.list(Mm).optional())});var Bm=r.object({content:r.record(r.string(),Nm).optional(),details:Wm.optional()});var Vm=r.enum_(["general","tool","llm","guardrail"]);var ii=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:Vm.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(pe).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 Lm=r.object({id:r.string(),name:r.string(),datasetId:r.property("dataset_id",r.string()),datasetItemId:r.property("dataset_item_id",r.string())});var Hm=r.object({spanId:r.property("span_id",r.string().optional()),checks:r.list(Jl).optional()});var Jm=r.enum_(["default","hidden"]);var ai=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(pe).optional()),spanFeedbackScores:r.property("span_feedback_scores",r.list(pe).optional()),comments:r.list(O).optional(),guardrailsValidations:r.property("guardrails_validations",r.list(Hm).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",Jm.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(),experiment:Lm.optional()});var Gm=r.object({datasetItemId:r.property("dataset_item_id",r.string()),evaluateTaskResult:r.property("evaluate_task_result",K.optional()),trace:ai.optional(),spans:r.list(ii).optional(),feedbackScores:r.property("feedback_scores",r.list(pe).optional())});var ux=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(Gm)});var Km=r.object({id:r.string(),name:r.string(),datasetId:r.property("dataset_id",r.string()),datasetItemId:r.property("dataset_item_id",r.string())});var $m=r.enum_(["running","completed","cancelled"]);var Qm=r.enum_(["regular","trial","mini-batch"]);var Ym=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 ni=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var $a=r.object({id:r.string(),commit:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),promptName:r.property("prompt_name",r.string().optional())});var si=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()),projectName:r.property("project_name",r.string().optional()),name:r.string().optional(),metadata:ye.optional(),tags:r.list(r.string()).optional(),type:Qm.optional(),optimizationId:r.property("optimization_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(sr).optional()),comments:r.list(yr).optional(),traceCount:r.property("trace_count",r.number().optional()),createdAt:r.property("created_at",r.date().optional()),duration:ni.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:$m.optional(),experimentScores:r.property("experiment_scores",r.list(Ym).optional()),promptVersion:r.property("prompt_version",$a.optional()),promptVersions:r.property("prompt_versions",r.list($a).optional()),datasetVersionId:r.property("dataset_version_id",r.string().optional()),datasetVersionSummary:r.property("dataset_version_summary",ei.optional())});var Xm=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 fx=V;var Zm=r.object({max:r.number(),min:r.number()});var Om=r.object({details:Zm.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 qm=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()}),hx=r.union("type",{numerical:Om.extend(qm),categorical:jl.extend(qm),boolean:zl.extend(qm)}).transform({transform:s=>s,untransform:s=>s});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:Cl.extend(td),boolean:Pl.extend(td)}).transform({transform:s=>s,untransform:s=>s});var id=r.object({max:r.number(),min:r.number()});var pi=r.object({details:id.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 ad=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()}),nd=r.union("type",{numerical:pi.extend(ad),categorical:Yo.extend(ad),boolean:Qo.extend(ad)}).transform({transform:s=>s,untransform:s=>s});var sd=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(nd).optional()});var pd=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()}),cd=r.union("type",{numerical:pi.extend(pd),categorical:Yo.extend(pd),boolean:Qo.extend(pd)}).transform({transform:s=>s,untransform:s=>s});var ld=r.object({name:r.string(),value:r.number()});var md=r.enum_(["ui","sdk","online_scoring"]);var dd=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:md,author:r.string().optional(),id:r.string()});var ci=r.object({scores:r.list(dd)});var ud=r.object({name:r.string().optional(),type:r.string().optional()});var fd=r.object({scores:r.list(ud).optional()});var hd=r.enum_(["ui","sdk","online_scoring"]);var gd=r.enum_(["ui","sdk","online_scoring"]);var yd=r.object({value:r.number().optional(),reason:r.string().optional(),categoryName:r.property("category_name",r.string().optional()),source:gd.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 Kr=r.object({name:r.string(),categoryName:r.property("category_name",r.string().optional()),value:r.number(),reason:r.string().optional(),source:hd,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(),yd).optional())});var bd=r.object({max:r.number(),min:r.number()});var Rd=r.object({details:bd.optional()});var xd=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional()}),wd=r.union("type",{numerical:Rd.extend(xd),categorical:Ul.extend(xd),boolean:Tl.extend(xd)}).transform({transform:s=>s,untransform:s=>s});var _d=r.enum_(["TOPIC","PII"]);var zd=r.enum_(["passed","failed"]);var kd=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:_d,result:zd,config:V,details:V});var gx=r.object({guardrails:r.list(kd)});var Pd=r.object({spanId:r.property("span_id",r.string().optional()),checks:r.list($l).optional()});var yx=r.object({ids:r.list(r.string())});var Sd=r.enum_(["INFO","WARN","ERROR","DEBUG","TRACE"]);var Ad=r.object({timestamp:r.date().optional(),ruleId:r.property("rule_id",r.string().optional()),level:Sd.optional(),message:r.string().optional(),markers:r.record(r.string(),r.string()).optional()});var Td=r.object({content:r.list(Ad).optional(),page:r.number().optional(),size:r.number().optional(),total:r.number().optional()});var vd=r.enum_(["trace","thread","span"]);var li=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",vd)});var mi=r.object({entitiesQueued:r.property("entities_queued",r.number().optional()),rulesApplied:r.property("rules_applied",r.number().optional())});var Qa=r.object({connected:r.boolean().optional(),version:r.string().optional(),errorMessage:r.property("error_message",r.string().optional())});var Ya=r.object({baseUrl:r.property("base_url",r.string()),apiKey:r.property("api_key",r.string().optional())});var jd=r.enum_(["running","completed","cancelled","initialized","error"]);var Ed=r.object({type:r.string(),parameters:V.optional()});var Cd=r.object({metrics:r.list(Ed)});var Id=r.object({model:r.string(),parameters:V.optional()});var Dd=r.object({type:r.string(),parameters:V.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 bx=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:jd,metadata:K.optional(),studioConfig:r.property("studio_config",Nd.optional()),datasetId:r.property("dataset_id",r.string().optional()),numTrials:r.property("num_trials",r.number().optional()),feedbackScores:r.property("feedback_scores",r.list(de).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 Md=r.enum_(["running","completed","cancelled","initialized","error"]);var Wd=r.object({type:r.string(),parameters:ce.optional()});var Bd=r.object({metrics:r.list(Wd)});var Vd=r.object({model:r.string(),parameters:ce.optional()});var Ld=r.object({type:r.string(),parameters:ce.optional()});var Hd=r.object({role:r.string(),content:r.string()});var Jd=r.object({messages:r.list(Hd)});var Gd=r.object({datasetName:r.property("dataset_name",r.string()),prompt:Jd,llmModel:r.property("llm_model",Vd),evaluation:Bd,optimizer:Ld});var di=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:Md,metadata:ye.optional(),studioConfig:r.property("studio_config",Gd.optional()),datasetId:r.property("dataset_id",r.string().optional()),numTrials:r.property("num_trials",r.number().optional()),feedbackScores:r.property("feedback_scores",r.list(sr).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 Kd=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 $d=r.object({type:r.string(),parameters:he.optional()});var Qd=r.object({metrics:r.list($d)});var Yd=r.object({model:r.string(),parameters:he.optional()});var Xd=r.object({type:r.string(),parameters:he.optional()});var Zd=r.object({role:r.string(),content:r.string()});var Od=r.object({messages:r.list(Zd)});var qd=r.object({datasetName:r.property("dataset_name",r.string()),prompt:Od,llmModel:r.property("llm_model",Yd),evaluation:Qd,optimizer:Xd});var eu=r.object({url:r.string().optional(),lastModified:r.property("last_modified",r.date().optional()),expiresAt:r.property("expires_at",r.date().optional())});var ru=r.enum_(["running","completed","cancelled","initialized","error"]);var Xa=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:ru,metadata:ge.optional(),studioConfig:r.property("studio_config",qd.optional()),lastUpdatedAt:r.property("last_updated_at",r.date().optional())});var tu=r.object({columns:r.list(Zl).optional()});var ou=r.object({value:ni.optional()});var iu=r.object({p50:r.number().optional(),p90:r.number().optional(),p99:r.number().optional()});var au=r.enum_(["private","public"]);var Rx=r.object({id:r.string().optional(),name:r.string(),visibility:au.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(de).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",ti.optional())});var nu=r.enum_(["private","public"]);var su=r.object({id:r.string().optional(),name:r.string(),visibility:nu.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(ld).optional()),duration:iu.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",Cm.optional())});var pu=r.enum_(["HOURLY","DAILY","WEEKLY"]);var cu=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 lu=r.object({name:r.string().optional(),data:r.list(sm).optional()});var mu=r.object({projectId:r.property("project_id",r.string().optional()),metricType:r.property("metric_type",cu.optional()),interval:pu.optional(),results:r.list(lu).optional()});var du=r.enum_(["private","public"]);var ui=r.object({id:r.string().optional(),name:r.string(),visibility:du.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 uu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ui).optional(),sortableBy:r.list(r.string()).optional()});var fu=r.object({name:r.string().optional()}),hu=r.union("type",{PERCENTAGE:ou.extend(fu),COUNT:am.extend(fu),AVG:xl.extend(fu)}).transform({transform:s=>s,untransform:s=>s});var Ge=r.object({stats:r.list(hu).optional()});var gu=r.object({projectId:r.property("project_id",r.string().optional()),feedbackScores:r.property("feedback_scores",r.list(de).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",ti.optional())});var yu=r.object({content:r.list(gu).optional()});var bu=r.enum_(["text","chat"]);var Ru=r.enum_(["mustache","jinja2"]);var xu=r.enum_(["text","chat"]);var wu=r.enum_(["mustache","jinja2"]);var _u=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:V.optional(),type:wu.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",xu.optional()),createdAt:r.property("created_at",r.date().optional()),createdBy:r.property("created_by",r.string().optional())});var xx=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),template:r.string().optional(),metadata:V.optional(),changeDescription:r.property("change_description",r.string().optional()),type:Ru.optional(),templateStructure:r.property("template_structure",bu.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",_u.optional())});var zu=r.enum_(["text","chat"]);var ku=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),templateStructure:r.property("template_structure",zu.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 Pu=r.enum_(["text","chat"]);var Su=r.object({id:r.string().optional(),name:r.string(),description:r.string().optional(),templateStructure:r.property("template_structure",Pu.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 Au=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(Su).optional(),sortableBy:r.list(r.string()).optional()});var Tu=r.enum_(["text","chat"]);var vu=r.enum_(["mustache","jinja2"]);var ju=r.object({id:r.string().optional(),promptId:r.property("prompt_id",r.string().optional()),commit:r.string().optional(),template:r.string(),metadata:ce.optional(),type:vu.optional(),changeDescription:r.property("change_description",r.string().optional()),tags: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 Eu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(ju).optional(),sortableBy:r.list(r.string()).optional()});var Cu=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","bedrock","ollama","custom-llm","opik-free"]);var wx=r.object({id:r.string().optional(),provider:Cu,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 Iu=r.enum_(["openai","anthropic","gemini","openrouter","vertex-ai","bedrock","ollama","custom-llm","opik-free"]);var fi=r.object({id:r.string().optional(),provider:Iu,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 Du=r.object({size:r.number().optional(),total:r.number().optional(),content:r.list(fi).optional(),sortableBy:r.list(r.string()).optional()});var Rr=r.object({name:r.string().optional(),current:r.number().optional(),previous:r.number().optional()});var Uu=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(),ollamaProviderEnabled:r.boolean(),collaboratorsTabEnabled:r.boolean()});var _x=r.object({spans:r.list(ii)});var Fu=r.enum_(["general","tool","llm","guardrail"]);var hi=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:Fu.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",oi.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(Kr).optional()),comments:r.list(yr).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 Nu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(hi).optional(),sortableBy:r.list(r.string()).optional()});var Mu=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(Mu).optional())});var Bu=r.object({uploadId:r.property("upload_id",r.string()),preSignUrls:r.property("pre_sign_urls",r.list(r.string()))});var Vu=r.object({names:r.list(r.string()).optional()});var zx=r.object({traces:r.list(ai)});var Lu=r.object({workspace:r.string().optional(),traceCount:r.property("trace_count",r.number().optional())});var Hu=r.object({workspacesTracesCount:r.property("workspaces_traces_count",r.list(Lu).optional())});var Ju=r.enum_(["default","hidden"]);var gi=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",oi.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(Kr).optional()),spanFeedbackScores:r.property("span_feedback_scores",r.list(Kr).optional()),comments:r.list(yr).optional(),guardrailsValidations:r.property("guardrails_validations",r.list(Pd).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",Ju.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(),experiment:Km.optional()});var Gu=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(gi).optional(),sortableBy:r.list(r.string()).optional()});var Ku=r.enum_(["active","inactive"]);var yi=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(pe).optional()),status:Ku.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 Za=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 $u=r.object({page:r.number().optional(),size:r.number().optional(),total:r.number().optional(),content:r.list(yi).optional(),sortableBy:r.list(r.string()).optional()});var Qu=r.object({responseExamples:r.property("response_examples",r.record(r.string(),r.record(r.string(),r.unknown())).optional())});var Yu=r.enum_(["success","failure"]);var Xu=r.object({status:Yu.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 Zu=r.object({completed:r.boolean().optional()});var bi=r.object({timeoutToMarkThreadAsInactive:r.property("timeout_to_mark_thread_as_inactive",r.string().optional()),truncationOnTables:r.property("truncation_on_tables",r.boolean().optional())});var kx=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 Oa=r.object({results:r.list(Rr).optional()});var $r=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 Ou=r.object({results:r.list(Rr).optional()});var qu=r.object({workspaceName:r.property("workspace_name",r.string().optional())});var qa=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,R,T,v,E,C;let{page:t,size:i,sorting:a,filters:n}=o,p={page:t,size:i,sorting:a,filters:n},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/private/alerts"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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:Gp.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/alerts"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:vo.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 Q(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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/alerts/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/alerts/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:To.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/alerts/${x.encodePathParam(o)}`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:vo.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new D(n.error.body,n.rawResponse);case 409:throw new $(n.error.body,n.rawResponse);case 422:throw new Q(n.error.body,n.rawResponse);default:throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return A(n.error,n.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,R,T;let{alertType:t}=o,i={alert_type:t!=null?ra.jsonOrThrow(t,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0},a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.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:(R=e==null?void 0:e.maxRetries)!=null?R:(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(n.ok)return {data:Qu.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"GET","/v1/private/alerts/webhooks/examples")}testWebhook(o,e){return _.fromPromise(this.__testWebhook(o,e))}async __testWebhook(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/alerts/webhooks/tests"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:vo.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:Xu.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 Q(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 en=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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/annotation-queues/${x.encodePathParam(o)}/items/add`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Ha.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v,E,C,U;let{page:t,size:i,name:a,filters:n,sorting:p}=o,l={page:t,size:i,name:a,filters:n,sorting:p},c=z((m=this._options)==null?void 0:m.headers,S({"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:x.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:P.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:(R=this._options)==null?void 0:R.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:oc.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/annotation-queues"),method:"POST",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 422:throw new Q(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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/annotation-queues/batch"),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: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 Q(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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/annotation-queues/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/annotation-queues/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:jo.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/annotation-queues/${x.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:(R=this._options)==null?void 0:R.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/annotation-queues/${x.encodePathParam(o)}/items/delete`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Ha.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"POST","/v1/private/annotation-queues/{id}/items/delete")}};var rn=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,R,T,v,E,C,U,M;let{page:t,size:i,projectId:a,entityType:n,entityId:p,path:l}=o,c={page:t,size:i,project_id:a,entity_type:na.jsonOrThrow(n,{unrecognizedObjectKeys:"strip",omitUndefined:true}),entity_id:p,path:l},d=z((f=this._options)==null?void 0:f.headers,S({"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:x.join((R=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?R:P.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:pc.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 se(ae.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/attachment/upload-complete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ja.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 se(ae.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/attachment/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ja.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 se(ae.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,R,T,v,E,C,U,M;let{workspaceName:t,containerId:i,entityType:a,entityId:n,fileName:p,mimeType:l}=o,c={workspace_name:t,container_id:i,entity_type:sa.jsonOrThrow(a,{unrecognizedObjectKeys:"strip",omitUndefined:true}),entity_id:n,file_name:p,mime_type:l},d=z((f=this._options)==null?void 0:f.headers,S({"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:x.join((R=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?R:P.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 se(ae.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/attachment/upload-start"),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:Bu.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 se(ae.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,R,T,v,E,C,U,M;let{fileName:t,projectName:i,mimeType:a,entityType:n,entityId:p,body:l}=o,c={file_name:t,project_name:i,mime_type:a,entity_type:pa.jsonOrThrow(n,{unrecognizedObjectKeys:"strip",omitUndefined:true}),entity_id:p},d=z((f=this._options)==null?void 0:f.headers,S({"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:x.join((R=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?R:P.Default,"v1/private/attachment/upload"),method:"PUT",headers:d,contentType:"application/json",queryParameters:{...c,...e==null?void 0:e.queryParams},requestType:"json",body:Cr.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 se(ae.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 tn=class{constructor(o={}){this._options=F(o);}findEvaluators(o={},e){return _.fromPromise(this.__findEvaluators(o,e))}async __findEvaluators(o={},e){var u,h,g,R,T,v,E,C,U,M,Z;let{projectId:t,id:i,name:a,filters:n,sorting:p,page:l,size:c}=o,d={project_id:t,id:i,name:a,filters:n,sorting:p,page:l,size:c},m=z((u=this._options)==null?void 0:u.headers,S({"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:x.join((T=(R=await b.get(this._options.baseUrl))!=null?R:await b.get(this._options.environment))!=null?T:P.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:(Z=this._options)==null?void 0:Z.fetch,logging:this._options.logging});if(f.ok)return {data:Yc.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/automations/evaluators"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Rl.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,R,T,v;let{projectId:t,body:i}=o,a={project_id:t},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,"v1/private/automations/evaluators/delete"),method:"POST",headers:n,contentType:"application/json",queryParameters:{...a,...e==null?void 0:e.queryParams},requestType:"json",body:X.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:(R=this._options)==null?void 0:R.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,R,T,v;let{projectId:i}=e,a={project_id:i},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,`v1/private/automations/evaluators/${x.encodePathParam(o)}`),method:"GET",headers:n,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:(R=this._options)==null?void 0:R.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:Zc.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/automations/evaluators/${x.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:hl.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v;let{size:i}=e,a={size:i},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,`v1/private/automations/evaluators/${x.encodePathParam(o)}/logs`),method:"GET",headers:n,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:(R=this._options)==null?void 0:R.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:Td.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 on=class{constructor(o={}){this._options=F(o);}createChatCompletions(o={},e){return _.fromPromise(this.__createChatCompletions(o,e))}async __createChatCompletions(o={},e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/chat/completions"),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:Vl.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 an=class{constructor(o={}){this._options=F(o);}access(o,e){return _.fromPromise(this.__access(o,e))}async __access(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/auth"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:dc.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 se(ae.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:qu.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 se(ae.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 nn=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,R,T,v,E,C;let{page:t,size:i,name:a,sorting:n}=o,p={page:t,size:i,name:a,sorting:n},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/private/dashboards"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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:nm.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/dashboards"),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:br.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/dashboards/${x.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:(R=this._options)==null?void 0:R.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,"GET","/v1/private/dashboards/{dashboardId}")}deleteDashboard(o,e={},t){return _.fromPromise(this.__deleteDashboard(o,e,t))}async __deleteDashboard(o,e={},t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/dashboards/${x.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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/dashboards/${x.encodePathParam(o)}`),method:"PATCH",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Rt.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:(R=this._options)==null?void 0:R.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")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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/dashboards/delete-batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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 sn=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,R,T,v,E;let{override:i,body:a}=e,n={override:i},p=z((c=this._options)==null?void 0:c.headers,S({"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:x.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/items/changes`),method:"POST",headers:p,contentType:"application/json",queryParameters:{...n,...t==null?void 0:t.queryParams},requestType:"json",body:dm.jsonOrThrow(a,{unrecognizedObjectKeys:"strip",omitUndefined:true}),timeoutMs:((R=(g=t==null?void 0:t.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?R: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")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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/items/batch"),method:"PATCH",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,"PATCH","/v1/private/datasets/items/batch")}findDatasets(o={},e){return _.fromPromise(this.__findDatasets(o,e))}async __findDatasets(o={},e){var h,g,R,T,v,E,C,U,M,Z,ie;let{page:t,size:i,withExperimentsOnly:a,withOptimizationsOnly:n,promptId:p,name:l,sorting:c,filters:d}=o,m={page:t,size:i,with_experiments_only:a,with_optimizations_only:n,prompt_id:p,name:l,sorting:c,filters:d},f=z((h=this._options)==null?void 0:h.headers,S({"Comet-Workspace":(R=e==null?void 0:e.workspaceName)!=null?R:(g=this._options)==null?void 0:g.workspaceName}),e==null?void 0:e.headers),u=await k({url:x.join((v=(T=await b.get(this._options.baseUrl))!=null?T:await b.get(this._options.environment))!=null?v:P.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:(Z=e==null?void 0:e.maxRetries)!=null?Z:(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: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")}createDataset(o,e){return _.fromPromise(this.__createDataset(o,e))}async __createDataset(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets"),method:"POST",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")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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/items"),method:"PUT",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,"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,R,T;let t=await yh();t.append("file",Pe(o.file)),t.append("dataset_id",o.datasetId);let i=await t.getRequest(),a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.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:(R=e==null?void 0:e.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new D(n.error.body,n.rawResponse);case 404:throw new I(n.error.body,n.rawResponse);default:throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return A(n.error,n.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/items/from-spans`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:wt.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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/items/from-traces`),method:"POST",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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Jr.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.encodePathParam(o)}`),method:"PUT",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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.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:(R=this._options)==null?void 0:R.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/delete"),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")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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/items/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Et.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/delete-batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/export-jobs/${x.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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/expansions`),method:"POST",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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:mm.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,R,T,v,E,C,U,M,Z,ie;let{page:i,size:a,experimentIds:n,filters:p,sorting:l,search:c,truncate:d}=e,m={page:i,size:a,experiment_ids:n,filters:p,sorting:l,search:c,truncate:d},f=z((h=this._options)==null?void 0:h.headers,S({"Comet-Workspace":(R=t==null?void 0:t.workspaceName)!=null?R:(g=this._options)==null?void 0:g.workspaceName}),t==null?void 0:t.headers),u=await k({url:x.join((v=(T=await b.get(this._options.baseUrl))!=null?T:await b.get(this._options.environment))!=null?v:P.Default,`v1/private/datasets/${x.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:(Z=t==null?void 0:t.maxRetries)!=null?Z:(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:wm.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/retrieve"),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:Jr.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,R,T,v,E;let{experimentIds:i,filters:a}=e,n={experiment_ids:i,filters:a},p=z((c=this._options)==null?void 0:c.headers,S({"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:x.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/items/experiments/items/stats`),method:"GET",headers:p,queryParameters:{...n,...t==null?void 0:t.queryParams},timeoutMs:((R=(g=t==null?void 0:t.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?R: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:Ge.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/export-jobs/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Ir.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Dr.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/items/${x.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:(R=this._options)==null?void 0:R.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/datasets/items/${x.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Tt.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v,E,C,U,M;let{page:i,size:a,version:n,filters:p,truncate:l}=e,c={page:i,size:a,version:n,filters:p,truncate:l},d=z((f=this._options)==null?void 0:f.headers,S({"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:x.join((R=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?R:P.Default,`v1/private/datasets/${x.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:km.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,R,T,v;let{experimentIds:i}=e,a={experiment_ids:i},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/items/experiments/items/output/columns`),method:"GET",headers:n,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:(R=this._options)==null?void 0:R.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:tu.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/export-jobs/${x.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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Ir.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/datasets/items/stream"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:jt.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:vm.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,R,T;let a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/versions/hash/${x.encodePathParam(e)}/tags`),method:"POST",headers:a,contentType:"application/json",queryParameters:i==null?void 0:i.queryParams,requestType:"json",body:Ut.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:(R=i==null?void 0:i.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new D(n.error.body,n.rawResponse);case 404:throw new I(n.error.body,n.rawResponse);case 409:throw new $(n.error.body,n.rawResponse);default:throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return A(n.error,n.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,R,T,v;let n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/versions/${x.encodePathParam(e)}/tags/${x.encodePathParam(t)}`),method:"DELETE",headers:n,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:(R=this._options)==null?void 0:R.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,R,T,v,E;let{page:i,size:a}=e,n={page:i,size:a},p=z((c=this._options)==null?void 0:c.headers,S({"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:x.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/versions`),method:"GET",headers:p,queryParameters:{...n,...t==null?void 0:t.queryParams},timeoutMs:((R=(g=t==null?void 0:t.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?R: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:jm.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/versions/restore`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:It.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Je.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")}retrieveDatasetVersion(o,e,t){return _.fromPromise(this.__retrieveDatasetVersion(o,e,t))}async __retrieveDatasetVersion(o,e,t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/versions/retrieve`),method:"POST",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Dt.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Je.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/datasets/{id}/versions/retrieve")}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,R,T;let a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/datasets/${x.encodePathParam(o)}/versions/hash/${x.encodePathParam(e)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:i==null?void 0:i.queryParams,requestType:"json",body:Ft.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:(R=i==null?void 0:i.maxRetries)!=null?R:(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(n.ok)return {data:Je.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new D(n.error.body,n.rawResponse);case 404:throw new I(n.error.body,n.rawResponse);case 409:throw new $(n.error.body,n.rawResponse);default:throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return A(n.error,n.rawResponse,"PATCH","/v1/private/datasets/{id}/versions/hash/{versionHash}")}};var pn=class{constructor(o={}){this._options=F(o);}batchUpdateExperiments(o,e){return _.fromPromise(this.__batchUpdateExperiments(o,e))}async __batchUpdateExperiments(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/batch"),method:"PATCH",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 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,Z,ie,ze,ke,Ve,tt,ot,gf;let{page:t,size:i,datasetId:a,optimizationId:n,types:p,name:l,datasetDeleted:c,promptId:d,projectId:m,projectDeleted:f,sorting:u,filters:h,experimentIds:g,forceSorting:R}=o,T={page:t,size:i,datasetId:a,optimization_id:n,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:R},v=z((C=this._options)==null?void 0:C.headers,S({"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:x.join((ie=(Z=await b.get(this._options.baseUrl))!=null?Z:await b.get(this._options.environment))!=null?ie:P.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:(ot=e==null?void 0:e.maxRetries)!=null?ot:(tt=this._options)==null?void 0:tt.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(gf=this._options)==null?void 0:gf.fetch,logging:this._options.logging});if(E.ok)return {data:Xm.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments"),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: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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/items"),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: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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/items/delete"),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")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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/delete"),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: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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/items/bulk"),method:"PUT",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 Q(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,R,T;let{experimentIds:t}=o,i={experiment_ids:t},a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.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:(R=e==null?void 0:e.maxRetries)!=null?R:(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(n.ok)return {data:Ur.findFeedbackScoreNames.Response.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v,E,C,U;let{groups:t,types:i,name:a,projectId:n,filters:p}=o,l={groups:t,types:i,name:a,project_id:n,filters:p},c=z((m=this._options)==null?void 0:m.headers,S({"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:x.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:P.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:(R=this._options)==null?void 0:R.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:Bm.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,R,T,v,E,C,U;let{groups:t,types:i,name:a,projectId:n,filters:p}=o,l={groups:t,types:i,name:a,project_id:n,filters:p},c=z((m=this._options)==null?void 0:m.headers,S({"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:x.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:P.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:(R=this._options)==null?void 0:R.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:Fm.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/finish"),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: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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/experiments/${x.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:(R=this._options)==null?void 0:R.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/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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/experiments/${x.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Wt.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new D(n.error.body,n.rawResponse);case 404:throw new I(n.error.body,n.rawResponse);default:throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return A(n.error,n.rawResponse,"PATCH","/v1/private/experiments/{id}")}getExperimentItemById(o,e={},t){return _.fromPromise(this.__getExperimentItemById(o,e,t))}async __getExperimentItemById(o,e={},t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/experiments/items/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Oo.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/items/stream"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ht.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/experiments/stream"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:$t.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 cn=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,R,T,v,E,C;let{page:t,size:i,name:a,type:n}=o,p={page:t,size:i,name:a,type:n!=null?ba.jsonOrThrow(n,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/private/feedback-definitions"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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:sd.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/feedback-definitions"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:od.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/feedback-definitions/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:cd.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/feedback-definitions/${x.encodePathParam(o)}`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:wd.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PUT","/v1/private/feedback-definitions/{id}")}deleteFeedbackDefinitionById(o,e={},t){return _.fromPromise(this.__deleteFeedbackDefinitionById(o,e,t))}async __deleteFeedbackDefinitionById(o,e={},t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/feedback-definitions/${x.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:(R=this._options)==null?void 0:R.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/feedback-definitions/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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 ln=class{constructor(o={}){this._options=F(o);}createGuardrails(o,e){return _.fromPromise(this.__createGuardrails(o,e))}async __createGuardrails(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/guardrails"),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")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 mn=class{constructor(o={}){this._options=F(o);}deleteLlmProviderApiKeysBatch(o,e){return _.fromPromise(this.__deleteLlmProviderApiKeysBatch(o,e))}async __deleteLlmProviderApiKeysBatch(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/llm-provider-key/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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: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/llm-provider-key")}storeLlmProviderApiKey(o,e){return _.fromPromise(this.__storeLlmProviderApiKey(o,e))}async __storeLlmProviderApiKey(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/llm-provider-key"),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 401:throw new re(i.error.body,i.rawResponse);case 403:throw new se(ae.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/llm-provider-key/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:fi.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/llm-provider-key/${x.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:(R=this._options)==null?void 0:R.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 se(ae.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 dn=class{constructor(o={}){this._options=F(o);}evaluateSpans(o,e){return _.fromPromise(this.__evaluateSpans(o,e))}async __evaluateSpans(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/manual-evaluation/spans"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:li.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 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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/manual-evaluation/threads"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:li.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 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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/manual-evaluation/traces"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:li.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 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 un=class{constructor(o={}){this._options=F(o);}listModels(o,e){return _.fromPromise(this.__listModels(o,e))}async __listModels(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/ollama/models"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ya.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:Fr.listModels.Response.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 422:throw new Q(i.error.body,i.rawResponse);case 500:throw new pt(i.error.body,i.rawResponse);case 503:throw new Sr(ae.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/ollama/models")}testConnection(o,e){return _.fromPromise(this.__testConnection(o,e))}async __testConnection(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/ollama/test-connection"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Ya.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:Qa.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 422:throw new Q(i.error.body,i.rawResponse);case 502:throw new st(Qa.parseOrThrow(i.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),i.rawResponse);case 503:throw new Sr(ae.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/ollama/test-connection")}};var fn=class{constructor(o={}){this._options=F(o);}receiveProtobufTraces(o){return _.fromPromise(this.__receiveProtobufTraces(o))}async __receiveProtobufTraces(o){var i,a,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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 hn=class{constructor(o={}){this._options=F(o);}cancelStudioOptimizations(o,e={},t){return _.fromPromise(this.__cancelStudioOptimizations(o,e,t))}async __cancelStudioOptimizations(o,e={},t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/optimizations/studio/${x.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:(R=this._options)==null?void 0:R.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 er(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,R,T,v,E,C,U,M;let{page:t,size:i,datasetId:a,name:n,datasetDeleted:p,filters:l}=o,c={page:t,size:i,dataset_id:a,name:n,dataset_deleted:p,filters:l},d=z((f=this._options)==null?void 0:f.headers,S({"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:x.join((R=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?R:P.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:Kd.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/optimizations"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Xa.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/optimizations"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Xa.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/optimizations/delete"),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: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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/optimizations/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:di.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/optimizations/${x.encodePathParam(o)}`),method:"PUT",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:Ot.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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/optimizations/studio/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:eu.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 gn=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,R,T,v,E,C;let{page:t,size:i,name:a,sorting:n}=o,p={page:t,size:i,name:a,sorting:n},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/private/projects"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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:uu.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/projects"),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 422:throw new Q(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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/projects/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:ui.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/projects/${x.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:(R=this._options)==null?void 0:R.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/projects/${x.encodePathParam(o)}`),method:"PATCH",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ro.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:(R=this._options)==null?void 0:R.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 Q(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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/projects/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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,R,T;let{projectIds:t}=o,i={project_ids:t},a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.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:(R=e==null?void 0:e.maxRetries)!=null?R:(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(n.ok)return {data:fd.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"GET","/v1/private/projects/feedback-scores/names")}findTokenUsageNames(o,e={},t){return _.fromPromise(this.__findTokenUsageNames(o,e,t))}async __findTokenUsageNames(o,e={},t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/projects/${x.encodePathParam(o)}/token-usage/names`),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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:Vu.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}/token-usage/names")}getProjectMetrics(o,e={},t){return _.fromPromise(this.__getProjectMetrics(o,e,t))}async __getProjectMetrics(o,e={},t){var n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/projects/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:mu.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,R,T,v,E,C;let{page:t,size:i,name:a,sorting:n}=o,p={page:t,size:i,name:a,sorting:n},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/private/projects/stats"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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:yu.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/projects/retrieve"),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:su.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 Q(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 yn=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,R,T,v,E,C,U;let{page:t,size:i,name:a,sorting:n,filters:p}=o,l={page:t,size:i,name:a,sorting:n,filters:p},c=z((m=this._options)==null?void 0:m.headers,S({"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:x.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:P.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:(R=this._options)==null?void 0:R.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:Au.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/prompts"),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")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 Q(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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/prompts/versions"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:oo.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 Q(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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/prompts/versions"),method:"PATCH",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 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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/prompts/${x.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:(R=this._options)==null?void 0:R.fetch,logging:this._options.logging});if(a.ok)return {data:ku.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/prompts/${x.encodePathParam(o)}`),method:"PUT",headers:i,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:io.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:(R=this._options)==null?void 0:R.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 Q(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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/prompts/${x.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:(R=this._options)==null?void 0:R.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/prompts/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/prompts/versions/${x.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:(R=this._options)==null?void 0:R.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,R,T,v,E,C,U,M;let{page:i,size:a,search:n,sorting:p,filters:l}=e,c={page:i,size:a,search:n,sorting:p,filters:l},d=z((f=this._options)==null?void 0:f.headers,S({"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:x.join((R=(g=await b.get(this._options.baseUrl))!=null?g:await b.get(this._options.environment))!=null?R:P.Default,`v1/private/prompts/${x.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:Eu.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,R,T;let a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/prompts/${x.encodePathParam(o)}/versions/${x.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:(R=i==null?void 0:i.maxRetries)!=null?R:(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(n.ok)return {data:Ee.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new D(n.error.body,n.rawResponse);case 404:throw new I(n.error.body,n.rawResponse);default:throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return A(n.error,n.rawResponse,"POST","/v1/private/prompts/{promptId}/versions/{versionId}/restore")}retrievePromptVersion(o,e){return _.fromPromise(this.__retrievePromptVersion(o,e))}async __retrievePromptVersion(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/prompts/versions/retrieve"),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: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 Q(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 bn=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,R,T,v,E;let{datasetId:t,workspaceName:i,path:a}=o,n={dataset_id:t,workspace_name:i,path:a},p=z((c=this._options)==null?void 0:c.headers,S({"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:x.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:P.Default,"v1/session/redirect/datasets"),method:"GET",headers:p,queryParameters:{...n,...e==null?void 0:e.queryParams},timeoutMs:((R=(g=e==null?void 0:e.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?R: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,R,T,v,E,C;let{datasetId:t,experimentId:i,workspaceName:a,path:n}=o,p={dataset_id:t,experiment_id:i,workspace_name:a,path:n},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/session/redirect/experiments"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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,R,T,v,E,C;let{datasetId:t,optimizationId:i,workspaceName:a,path:n}=o,p={dataset_id:t,optimization_id:i,workspace_name:a,path:n},l=z((d=this._options)==null?void 0:d.headers,S({"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:x.join((h=(u=await b.get(this._options.baseUrl))!=null?u:await b.get(this._options.environment))!=null?h:P.Default,"v1/session/redirect/optimizations"),method:"GET",headers:l,queryParameters:{...p,...e==null?void 0:e.queryParams},timeoutMs:((T=(R=e==null?void 0:e.timeoutInSeconds)!=null?R:(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,R,T,v,E;let{traceId:t,workspaceName:i,path:a}=o,n={trace_id:t,workspace_name:i,path:a},p=z((c=this._options)==null?void 0:c.headers,S({"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:x.join((u=(f=await b.get(this._options.baseUrl))!=null?f:await b.get(this._options.environment))!=null?u:P.Default,"v1/session/redirect/projects"),method:"GET",headers:p,queryParameters:{...n,...e==null?void 0:e.queryParams},timeoutMs:((R=(g=e==null?void 0:e.timeoutInSeconds)!=null?g:(h=this._options)==null?void 0:h.timeoutInSeconds)!=null?R: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 Rn=class{constructor(o={}){this._options=F(o);}getServiceToggles(o){return _.fromPromise(this.__getServiceToggles(o))}async __getServiceToggles(o){var i,a,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Uu.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 xn=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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/spans/${x.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/spans/${x.encodePathParam(o)}/feedback-scores`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:pe.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PUT","/v1/private/spans/{id}/feedback-scores")}createSpans(o,e){return _.fromPromise(this.__createSpans(o,e))}async __createSpans(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/spans/batch"),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/spans/batch")}batchUpdateSpans(o,e){return _.fromPromise(this.__batchUpdateSpans(o,e))}async __batchUpdateSpans(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/spans/batch"),method:"PATCH",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 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,Z,ie,ze,ke,Ve,tt,ot;let{page:t,size:i,projectName:a,projectId:n,traceId:p,type:l,filters:c,truncate:d,stripAttachments:m,sorting:f,exclude:u,fromTime:h,toTime:g}=o,R={page:t,size:i,project_name:a,project_id:n,trace_id:p,type:l!=null?Wa.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,S({"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:x.join((Z=(M=await b.get(this._options.baseUrl))!=null?M:await b.get(this._options.environment))!=null?Z:P.Default,"v1/private/spans"),method:"GET",headers:T,queryParameters:{...R,...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:(tt=e==null?void 0:e.maxRetries)!=null?tt:(Ve=this._options)==null?void 0:Ve.maxRetries,withCredentials:true,abortSignal:e==null?void 0:e.abortSignal,fetchFn:(ot=this._options)==null?void 0:ot.fetch,logging:this._options.logging});if(v.ok)return {data:Nu.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/spans"),method:"POST",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===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,R,T,v;let{stripAttachments:i}=e,a={strip_attachments:i},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,`v1/private/spans/${x.encodePathParam(o)}`),method:"GET",headers:n,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:(R=this._options)==null?void 0:R.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:hi.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/spans/${x.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:(R=this._options)==null?void 0:R.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 er(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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/spans/${x.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:po.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PATCH","/v1/private/spans/{id}")}deleteSpanComments(o,e){return _.fromPromise(this.__deleteSpanComments(o,e))}async __deleteSpanComments(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/spans/comments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/spans/${x.encodePathParam(o)}/feedback-scores/delete`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ri.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v;let{projectId:t,type:i}=o,a={project_id:t,type:i!=null?Na.jsonOrThrow(i,{unrecognizedObjectKeys:"strip",omitUndefined:true}):void 0},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,"v1/private/spans/feedback-scores/names"),method:"GET",headers:n,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:(R=this._options)==null?void 0:R.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:Nr.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,R,T;let a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/spans/${x.encodePathParam(o)}/comments/${x.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:(R=i==null?void 0:i.maxRetries)!=null?R:(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(n.ok)return {data:O.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v,E,C,U,M,Z;let{projectId:t,projectName:i,traceId:a,type:n,filters:p,fromTime:l,toTime:c}=o,d={project_id:t,project_name:i,trace_id:a,type:n!=null?Ma.jsonOrThrow(n,{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,S({"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:x.join((T=(R=await b.get(this._options.baseUrl))!=null?R:await b.get(this._options.environment))!=null?T:P.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:(Z=this._options)==null?void 0:Z.fetch,logging:this._options.logging});if(f.ok)return {data:Ge.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/spans/feedback-scores"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ci.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/spans/search"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:fo.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/spans/comments/${x.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PATCH","/v1/private/spans/comments/{commentId}")}};var wn=class{constructor(o={}){this._options=F(o);}getDatasetBiInfo(o){return _.fromPromise(this.__getDatasetBiInfo(o))}async __getDatasetBiInfo(o){var i,a,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Hr.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Hr.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Hr.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Hr.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:Hu.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 _n=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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/threads/${x.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/${x.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/${x.encodePathParam(o)}/feedback-scores`),method:"PUT",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:pe.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PUT","/v1/private/traces/{id}/feedback-scores")}createTraces(o,e){return _.fromPromise(this.__createTraces(o,e))}async __createTraces(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/batch"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:wo.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/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/batch")}batchUpdateThreads(o,e){return _.fromPromise(this.__batchUpdateThreads(o,e))}async __batchUpdateThreads(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/batch"),method:"PATCH",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 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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/close"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:zo.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,Z,ie,ze,ke,Ve;let{page:t,size:i,projectName:a,projectId:n,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:n,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,S({"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),R=await k({url:x.join((U=(C=await b.get(this._options.baseUrl))!=null?C:await b.get(this._options.environment))!=null?U:P.Default,"v1/private/traces"),method:"GET",headers:g,queryParameters:{...h,...e==null?void 0:e.queryParams},timeoutMs:((ie=(Z=e==null?void 0:e.timeoutInSeconds)!=null?Z:(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(R.ok)return {data:Gu.parseOrThrow(R.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:R.rawResponse};if(R.error.reason==="status-code")throw new w({statusCode:R.error.statusCode,body:R.error.body,rawResponse:R.rawResponse});return A(R.error,R.rawResponse,"GET","/v1/private/traces")}createTrace(o,e){return _.fromPromise(this.__createTrace(o,e))}async __createTrace(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:xo.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,R,T,v;let{stripAttachments:i}=e,a={strip_attachments:i},n=z((l=this._options)==null?void 0:l.headers,S({"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:x.join((f=(m=await b.get(this._options.baseUrl))!=null?m:await b.get(this._options.environment))!=null?f:P.Default,`v1/private/traces/${x.encodePathParam(o)}`),method:"GET",headers:n,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:(R=this._options)==null?void 0:R.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:gi.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 n,p,l,c,d,m,f,u,h,g,R;let i=z((n=this._options)==null?void 0:n.headers,S({"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:x.join((d=(c=await b.get(this._options.baseUrl))!=null?c:await b.get(this._options.environment))!=null?d:P.Default,`v1/private/traces/${x.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:(R=this._options)==null?void 0:R.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/${x.encodePathParam(o)}`),method:"PATCH",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:bo.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PATCH","/v1/private/traces/{id}")}deleteThreadComments(o,e){return _.fromPromise(this.__deleteThreadComments(o,e))}async __deleteThreadComments(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/comments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.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: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/threads/feedback-scores/delete")}deleteTraceComments(o,e){return _.fromPromise(this.__deleteTraceComments(o,e))}async __deleteTraceComments(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/comments/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/${x.encodePathParam(o)}/feedback-scores/delete`),method:"POST",headers:a,contentType:"application/json",queryParameters:t==null?void 0:t.queryParams,requestType:"json",body:ri.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"POST","/v1/private/traces/{id}/feedback-scores/delete")}deleteTraceThreads(o,e){return _.fromPromise(this.__deleteTraceThreads(o,e))}async __deleteTraceThreads(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/delete"),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/threads/delete")}deleteTraces(o,e){return _.fromPromise(this.__deleteTraces(o,e))}async __deleteTraces(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/delete"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:X.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,R,T;let{projectId:t}=o,i={project_id:t},a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.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:(R=e==null?void 0:e.maxRetries)!=null?R:(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(n.ok)return {data:nr.findFeedbackScoreNames2.Response.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T;let{projectId:t}=o,i={project_id:t},a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.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:(R=e==null?void 0:e.maxRetries)!=null?R:(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(n.ok)return {data:nr.findTraceThreadsFeedbackScoreNames.Response.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v,E,C,U;let{projectId:t,projectName:i,filters:a,fromTime:n,toTime:p}=o,l={project_id:t,project_name:i,filters:a,from_time:n==null?void 0:n.toISOString(),to_time:p==null?void 0:p.toISOString()},c=z((m=this._options)==null?void 0:m.headers,S({"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:x.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:P.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:(R=this._options)==null?void 0:R.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:Ge.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,R,T;let a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/threads/${x.encodePathParam(o)}/comments/${x.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:(R=i==null?void 0:i.maxRetries)!=null?R:(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(n.ok)return {data:O.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T,v,E,C,U;let{projectId:t,projectName:i,filters:a,fromTime:n,toTime:p}=o,l={project_id:t,project_name:i,filters:a,from_time:n==null?void 0:n.toISOString(),to_time:p==null?void 0:p.toISOString()},c=z((m=this._options)==null?void 0:m.headers,S({"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:x.join((g=(h=await b.get(this._options.baseUrl))!=null?h:await b.get(this._options.environment))!=null?g:P.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:(R=this._options)==null?void 0:R.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:Ge.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,R,T;let a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/${x.encodePathParam(o)}/comments/${x.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:(R=i==null?void 0:i.maxRetries)!=null?R:(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(n.ok)return {data:O.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:true,allowUnrecognizedEnumValues:true,skipValidation:true,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"GET","/v1/private/traces/{traceId}/comments/{commentId}")}getTraceThread(o,e){return _.fromPromise(this.__getTraceThread(o,e))}async __getTraceThread(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/retrieve"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Za.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:yi.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 R,T,v,E,C,U,M,Z,ie,ze,ke;let{page:t,size:i,projectName:a,projectId:n,truncate:p,stripAttachments:l,filters:c,sorting:d,fromTime:m,toTime:f}=o,u={page:t,size:i,project_name:a,project_id:n,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((R=this._options)==null?void 0:R.headers,S({"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:x.join((C=(E=await b.get(this._options.baseUrl))!=null?E:await b.get(this._options.environment))!=null?C:P.Default,"v1/private/traces/threads"),method:"GET",headers:h,queryParameters:{...u,...e==null?void 0:e.queryParams},timeoutMs:((Z=(M=e==null?void 0:e.timeoutInSeconds)!=null?M:(U=this._options)==null?void 0:U.timeoutInSeconds)!=null?Z: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:$u.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/open"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:Za.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/feedback-scores"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:yo.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/feedback-scores"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:ci.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/threads/search"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:So.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/traces/search"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:_o.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/threads/${x.encodePathParam(o)}`),method:"PATCH",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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/threads/comments/${x.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.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,R,T;let{body:i}=e,a=z((p=this._options)==null?void 0:p.headers,S({"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),n=await k({url:x.join((m=(d=await b.get(this._options.baseUrl))!=null?d:await b.get(this._options.environment))!=null?m:P.Default,`v1/private/traces/comments/${x.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:(R=t==null?void 0:t.maxRetries)!=null?R:(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(n.ok)return {data:void 0,rawResponse:n.rawResponse};if(n.error.reason==="status-code")throw n.error.statusCode===404?new I(n.error.body,n.rawResponse):new w({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse});return A(n.error,n.rawResponse,"PATCH","/v1/private/traces/comments/{commentId}")}};var zn=class{constructor(o={}){this._options=F(o);}getWelcomeWizardStatus(o){return _.fromPromise(this.__getWelcomeWizardStatus(o))}async __getWelcomeWizardStatus(o){var i,a,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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: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/private/welcome-wizard")}submitWelcomeWizard(o={},e){return _.fromPromise(this.__submitWelcomeWizard(o,e))}async __submitWelcomeWizard(o={},e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/welcome-wizard"),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/welcome-wizard")}};var kn=class{constructor(o={}){this._options=F(o);}costsSummary(o,e){return _.fromPromise(this.__costsSummary(o,e))}async __costsSummary(o,e){var a,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/workspaces/costs/summaries"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:$r.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:Rr.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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:bi.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/workspaces/configurations"),method:"PUT",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:bi.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:bi.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 Q(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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/workspaces/costs"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:$r.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:Oa.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/workspaces/metrics"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:$r.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:Oa.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,n,p,l,c,d,m,f,u,h,g;let t=z((a=this._options)==null?void 0:a.headers,S({"Comet-Workspace":(p=e==null?void 0:e.workspaceName)!=null?p:(n=this._options)==null?void 0:n.workspaceName}),e==null?void 0:e.headers),i=await k({url:x.join((c=(l=await b.get(this._options.baseUrl))!=null?l:await b.get(this._options.environment))!=null?c:P.Default,"v1/private/workspaces/metrics/summaries"),method:"POST",headers:t,contentType:"application/json",queryParameters:e==null?void 0:e.queryParams,requestType:"json",body:$r.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:Ou.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 Ri=class{constructor(o={}){this._options=F(o);}get systemUsage(){var o;return (o=this._systemUsage)!=null?o:this._systemUsage=new wn(this._options)}get alerts(){var o;return (o=this._alerts)!=null?o:this._alerts=new qa(this._options)}get annotationQueues(){var o;return (o=this._annotationQueues)!=null?o:this._annotationQueues=new en(this._options)}get attachments(){var o;return (o=this._attachments)!=null?o:this._attachments=new rn(this._options)}get check(){var o;return (o=this._check)!=null?o:this._check=new an(this._options)}get automationRuleEvaluators(){var o;return (o=this._automationRuleEvaluators)!=null?o:this._automationRuleEvaluators=new tn(this._options)}get chatCompletions(){var o;return (o=this._chatCompletions)!=null?o:this._chatCompletions=new on(this._options)}get dashboards(){var o;return (o=this._dashboards)!=null?o:this._dashboards=new nn(this._options)}get datasets(){var o;return (o=this._datasets)!=null?o:this._datasets=new sn(this._options)}get experiments(){var o;return (o=this._experiments)!=null?o:this._experiments=new pn(this._options)}get feedbackDefinitions(){var o;return (o=this._feedbackDefinitions)!=null?o:this._feedbackDefinitions=new cn(this._options)}get guardrails(){var o;return (o=this._guardrails)!=null?o:this._guardrails=new ln(this._options)}get llmProviderKey(){var o;return (o=this._llmProviderKey)!=null?o:this._llmProviderKey=new mn(this._options)}get manualEvaluation(){var o;return (o=this._manualEvaluation)!=null?o:this._manualEvaluation=new dn(this._options)}get ollama(){var o;return (o=this._ollama)!=null?o:this._ollama=new un(this._options)}get openTelemetryIngestion(){var o;return (o=this._openTelemetryIngestion)!=null?o:this._openTelemetryIngestion=new fn(this._options)}get optimizations(){var o;return (o=this._optimizations)!=null?o:this._optimizations=new hn(this._options)}get projects(){var o;return (o=this._projects)!=null?o:this._projects=new gn(this._options)}get prompts(){var o;return (o=this._prompts)!=null?o:this._prompts=new yn(this._options)}get serviceToggles(){var o;return (o=this._serviceToggles)!=null?o:this._serviceToggles=new Rn(this._options)}get spans(){var o;return (o=this._spans)!=null?o:this._spans=new xn(this._options)}get traces(){var o;return (o=this._traces)!=null?o:this._traces=new _n(this._options)}get welcomeWizard(){var o;return (o=this._welcomeWizard)!=null?o:this._welcomeWizard=new zn(this._options)}get workspaces(){var o;return (o=this._workspaces)!=null?o:this._workspaces=new kn(this._options)}get redirect(){var o;return (o=this._redirect)!=null?o:this._redirect=new bn(this._options)}isAlive(o){return _.fromPromise(this.__isAlive(o))}async __isAlive(o){var i,a,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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,n,p,l,c,d,m,f,u,h;let e=z((i=this._options)==null?void 0:i.headers,S({"Comet-Workspace":(n=o==null?void 0:o.workspaceName)!=null?n:(a=this._options)==null?void 0:a.workspaceName}),o==null?void 0:o.headers),t=await k({url:x.join((l=(p=await b.get(this._options.baseUrl))!=null?p:await b.get(this._options.environment))!=null?l:P.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 Oh;(e=>(e.LogLevel=fe,e.ConsoleLogger=rr))(Oh||(Oh={}));var ne=()=>uuid.v7();var Qr=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),n=this.normalizeMetadata(e);return {...a,...n,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 Pn=class s{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=Qr.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:ne(),startTime:new Date,...o,projectName:e,traceId:this.data.traceId,parentSpanId:this.data.id};this.opik.spanBatchQueue.create(t);let i=new s(t,this.opik);return this.childSpans.push(i),i};}};var Sn=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,n;let e=(n=(a=this.data.projectName)!=null?a:o.projectName)!=null?n:this.opik.config.projectName,t={id:ne(),startTime:new Date,...o,projectName:e,traceId:this.data.id};this.opik.spanBatchQueue.create(t);let i=new Pn(t,this.opik);return this.spans.push(i),i};this.update=o=>{var i;let e=Qr.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 qh={EXPERIMENTS:"api/v1/session/redirect/experiments/",PROJECTS:"api/v1/session/redirect/projects/"},xi={EXPERIMENT_ID:"experiment_id",DATASET_ID:"dataset_id",TRACE_ID:"trace_id",PATH:"path"},Sx=s=>Object.entries(s).map(([o,e])=>`${o}=${encodeURIComponent(e)}`).join("&").replace(/%3A/g,":").replace(/%2F/g,"/").replace(/%26/g,"&").replace(/%3F/g,"?").replace(/%3D/g,"=");var eg=s=>Buffer.from(s).toString("base64"),rg=(s,o,e)=>{let t=Sx(e),i=`${o}?${t}`;return new URL(i,s).toString()},tg=({datasetId:s,experimentId:o,baseUrl:e})=>rg(e,qh.EXPERIMENTS,{[xi.EXPERIMENT_ID]:o,[xi.DATASET_ID]:s,[xi.PATH]:eg(e)}),og=(s,o)=>rg(o,qh.PROJECTS,{[xi.TRACE_ID]:s,[xi.PATH]:eg(o)});var Ax=300,An=100,wi=class{constructor({action:o,batchSize:e=An,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;}},Re=class{constructor({delay:o=Ax,enableCreateBatch:e=true,enableUpdateBatch:t=false,enableDeleteBatch:i=true,createBatchSize:a=An,updateBatchSize:n=An,deleteBatchSize:p=An,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}let i=this.updateQueue.queue.get(o);this.updateQueue.add(o,{...i,...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 wi({action:async c=>{await this.createEntities(Array.from(c.values()));},delay:o,enableBatch:e,batchSize:a,name:`${l}:createQueue`}),this.updateQueue=new wi({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:n,name:`${l}:updateQueue`}),this.deleteQueue=new wi({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 Tn=class extends Re{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 vn=class extends Re{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 jn=class extends Re{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 En=class extends Re{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 Cn=class extends Ri{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 In=class extends Re{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 ef=null;async function ig(){return ef||(ef=await Tx__default.default()),ef}var _i=class s{constructor(o){let{id:e,traceId:t,spanId:i,source:a,...n}=o;this.id=e||ne(),this.traceId=t,this.spanId=i,this.source=a||ws.Sdk,this.data={...n};}getContent(o=false){return o?{...this.data,id:this.id}:{...this.data}}async contentHash(){let o=this.getContent(),e=vx__default.default(o);return (await ig()).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 s({id:o.id,traceId:o.traceId,spanId:o.spanId,source:o.source,...o.data})}};async function Ke(s,o,e){var p;if(e===0)return [];let t=new util.TextDecoder("utf-8"),i=[],a="",n=s.getReader();try{for(;;){let{done:l,value:c}=await n.read();if(l)break;let d=c;a+=t.decode(d,{stream:!0});let m=a.split(`
4
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 n.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{n.releaseLock();}return i}function zi(s,o){let e=[];for(let t=0;t<s.length;t+=o.maxBatchSize)e.push(s.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 ag={DATASET_NOT_FOUND:s=>`Dataset with name '${s}' not found`,DATASET_ITEM_NOT_FOUND:s=>`Dataset item with id '${s}' not found`,DATASET_ITEM_MISSING_ID:s=>`Item at index ${s} is missing an ID required for update`,INVALID_JSON_FORMAT:s=>`Invalid JSON format${s?": "+s:""}`,JSON_NOT_ARRAY:"JSON input must be an array of objects",ITEM_NOT_OBJECT:(s,o)=>`Item at position ${s} is not an object (${o})`,INSERTION_FAILED:s=>`Failed to insert items from JSON: ${s}`,DATASET_JSON_PARSE_ERROR:s=>`Failed to parse JSON input: ${s}`};var Ex={DATASET_ITEM_MISSING_ID:"DATASET_ITEM_MISSING_ID"},Dn=class extends be{constructor(o){super({message:ag.DATASET_ITEM_MISSING_ID(o),code:Ex.DATASET_ITEM_MISSING_ID});}};var Cx={SEARCH_TIMEOUT:"SEARCH_TIMEOUT"},Un=class extends be{constructor(o){super({message:o,code:Cx.SEARCH_TIMEOUT});}};var Fn={JSON_NOT_ARRAY:s=>`JSON input must be an array of objects${s?` (${s})`:""}`,JSON_PARSE_ERROR:"Failed to parse JSON input",JSON_ITEM_NOT_OBJECT:(s,o)=>`Item at position ${s} is not an object (${o})`};var rf={JSON_PARSE_ERROR:"JSON_PARSE_ERROR",JSON_NOT_ARRAY:"JSON_NOT_ARRAY",JSON_ITEM_NOT_OBJECT:"JSON_ITEM_NOT_OBJECT"},Nn=class extends be{constructor(o){let e=o instanceof Error?o:new Error(String(o));super({message:Fn.JSON_PARSE_ERROR,code:rf.JSON_PARSE_ERROR,originalError:e});}},Mn=class extends be{constructor(o){super({message:Fn.JSON_NOT_ARRAY(o),code:rf.JSON_NOT_ARRAY});}},Wn=class extends be{constructor(o,e){super({message:Fn.JSON_ITEM_NOT_OBJECT(o,e),code:rf.JSON_ITEM_NOT_OBJECT});}};var Yr=class{constructor({name:o,description:e,id:t},i){this.opik=i;this.idToHash=new Map;this.hashes=new Set;this.id=t||ne(),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=zi(e,{maxBatchSize:1e3}),i=ne();try{let a=0;for(let n of t)await this.opik.api.datasets.createOrUpdateDatasetItems({datasetId:this.id,items:n,batchGroupId:i}),a+=n.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 Dn(e);await this.insert(o);}}async delete(o){if(!o||o.length===0){j.info("No item IDs provided for deletion");return}let e=zi(o,{maxBatchSize:100}),t=ne();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 n=this.idToHash.get(a);this.hashes.delete(n),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 Ke(i,L.DatasetItemPublic,o)).map(n=>_i.fromApiModel(n))}async insertFromJson(o,e={},t=[]){let i;try{i=JSON.parse(o);}catch(n){throw new Nn(n)}if(!Array.isArray(i))throw new Mn(typeof i);if(i.length===0)return;for(let n=0;n<i.length;n++){let p=i[n];if(typeof p!="object"||p===null)throw new Wn(n,typeof p)}let a=i.map(n=>{let p=n,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[n,p]of Object.entries(o))if(n in a){let l=a[n];delete a[n],a[p]=l;}}return a});return vx__default.default(t)}async getDeduplicatedItems(o){let e=[];for(let t of o){let i=new _i(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 tf=class extends Error{constructor(o){super(o),this.name="DatasetError";}},ki=class extends tf{constructor(o){super(`Dataset with name '${o}' not found`),this.name="DatasetNotFoundError";}};var Bn=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;}},Vn=class s{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 s({id:o.id,traceId:o.traceId,datasetItemId:o.datasetItemId,datasetItemData:o.input,evaluationTaskOutput:o.output,feedbackScores:e})}};var xr=class{constructor({id:o,name:e,datasetName:t,prompts:i},a){this.opik=a;this.id=o||ne(),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:ne(),experimentId:this.id,datasetItemId:i.datasetItemId,traceId:i.traceId})),t=zi(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||{},n,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:n,truncate:a});try{let d=await Ke(c,L.ExperimentItemCompare,l);if(d.length===0){p=!1;break}for(let m of d){let f=Vn.fromRestExperimentItemCompare(m);if(e.push(f),i!==void 0&&e.length>=i){p=!1;break}}n=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||as.apiUrl;return tg({datasetId:o.id,experimentId:this.id,baseUrl:e})}};var Ln={EXPERIMENT_NOT_FOUND:s=>`Experiment with name '${s}' not found`,INVALID_CONFIG_TYPE:s=>`experimentConfig must be a plain object, but ${s} 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: {...} })