feat: manually mirror opencoze's code from bytedance

Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
fanlv
2025-07-20 17:36:12 +08:00
commit 890153324f
14811 changed files with 1923430 additions and 0 deletions

View File

@@ -0,0 +1,499 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
import * as base from './namespaces/base';
import * as flow_devops_ob_query_insight_indicators from './namespaces/flow_devops_ob_query_insight_indicators';
import * as flow_devops_ob_query_metrics from './namespaces/flow_devops_ob_query_metrics';
import * as flow_devops_ob_query_query from './namespaces/flow_devops_ob_query_query';
import * as flow_devops_ob_query_telemetry from './namespaces/flow_devops_ob_query_telemetry';
import * as flow_devops_ob_query_telemetry_common from './namespaces/flow_devops_ob_query_telemetry_common';
import * as flow_devops_ob_query_telemetry_field_filter from './namespaces/flow_devops_ob_query_telemetry_field_filter';
import * as flow_devops_ob_query_telemetry_span from './namespaces/flow_devops_ob_query_telemetry_span';
import * as ob_query from './namespaces/ob_query';
import * as ob_query_trace from './namespaces/ob_query_trace';
export {
base,
flow_devops_ob_query_insight_indicators,
flow_devops_ob_query_metrics,
flow_devops_ob_query_query,
flow_devops_ob_query_telemetry,
flow_devops_ob_query_telemetry_common,
flow_devops_ob_query_telemetry_field_filter,
flow_devops_ob_query_telemetry_span,
ob_query,
ob_query_trace,
};
export * from './namespaces/base';
export * from './namespaces/flow_devops_ob_query_insight_indicators';
export * from './namespaces/flow_devops_ob_query_metrics';
export * from './namespaces/flow_devops_ob_query_query';
export * from './namespaces/flow_devops_ob_query_telemetry';
export * from './namespaces/flow_devops_ob_query_telemetry_common';
export * from './namespaces/flow_devops_ob_query_telemetry_field_filter';
export * from './namespaces/flow_devops_ob_query_telemetry_span';
export * from './namespaces/ob_query';
export * from './namespaces/ob_query_trace';
export type Int64 = string | number;
export default class ObQueryApiService<T> {
private request: any = () => {
throw new Error('ObQueryApiService.request is undefined');
};
private baseURL: string | ((path: string) => string) = '';
constructor(options?: {
baseURL?: string | ((path: string) => string);
request?<R>(
params: {
url: string;
method: 'GET' | 'DELETE' | 'POST' | 'PUT' | 'PATCH';
data?: any;
params?: any;
headers?: any;
},
options?: T,
): Promise<R>;
}) {
this.request = options?.request || this.request;
this.baseURL = options?.baseURL || '';
}
private genBaseURL(path: string) {
return typeof this.baseURL === 'string'
? this.baseURL + path
: this.baseURL(path);
}
/**
* GET /api/devops/ob_query/query_trace
*
* 豆包&cici特化: 通过 logID/traceID/messageID 查询 tracing 数据
*/
QueryTrace(
req?: ob_query.QueryTraceRequest,
options?: T,
): Promise<ob_query.QueryTraceResponse> {
const _req = req || {};
const url = this.genBaseURL('/api/devops/ob_query/query_trace');
const method = 'GET';
const params = {
tenant: _req['tenant'],
trace_id: _req['trace_id'],
log_id: _req['log_id'],
message_id: _req['message_id'],
start_at: _req['start_at'],
end_at: _req['end_at'],
bot_id: _req['bot_id'],
workspace_id: _req['workspace_id'],
Base: _req['Base'],
};
return this.request({ url, method, params }, options);
}
/**
* POST /api/devops/ob_query/list_spans
*
* 豆包&cici特化: 通过 tag 关键字 查询 tracing 数据
*/
ListSpans(
req: ob_query.ListSpansRequest,
options?: T,
): Promise<ob_query.ListSpansResponse> {
const _req = req;
const url = this.genBaseURL('/api/devops/ob_query/list_spans');
const method = 'POST';
const data = {
tenant: _req['tenant'],
filter_tags: _req['filter_tags'],
start_at: _req['start_at'],
end_at: _req['end_at'],
limit: _req['limit'],
desc_by_start_time: _req['desc_by_start_time'],
context: _req['context'],
bot_id: _req['bot_id'],
workspace_id: _req['workspace_id'],
Base: _req['Base'],
};
return this.request({ url, method, data }, options);
}
/**
* POST /api/devops/ob_query/v1/traces
*
* 查询通用链路列表
*/
ListTraces(
req: flow_devops_ob_query_telemetry.ListTracesRequest,
options?: T,
): Promise<flow_devops_ob_query_telemetry.ListTracesResponse> {
const _req = req;
const url = this.genBaseURL('/api/devops/ob_query/v1/traces');
const method = 'POST';
const data = {
space_id: _req['space_id'],
bot_id: _req['bot_id'],
start_time: _req['start_time'],
end_time: _req['end_time'],
filters: _req['filters'],
full_text_search: _req['full_text_search'],
limit: _req['limit'],
order_by: _req['order_by'],
page_token: _req['page_token'],
};
return this.request({ url, method, data }, options);
}
/**
* POST /api/devops/ob_query/v1/traces/stat
*
* 查询链路统计指标
*/
GetTracesStat(
req: flow_devops_ob_query_telemetry.GetTracesStatRequest,
options?: T,
): Promise<flow_devops_ob_query_telemetry.GetTracesStatResponse> {
const _req = req;
const url = this.genBaseURL('/api/devops/ob_query/v1/traces/stat');
const method = 'POST';
const data = {
space_id: _req['space_id'],
bot_id: _req['bot_id'],
start_time: _req['start_time'],
end_time: _req['end_time'],
};
return this.request({ url, method, data }, options);
}
/**
* GET /api/devops/ob_query/v1/traces/meta_info
*
* 查询元信息包括字段类型filter opertor
*/
GetTracesMetaInfo(
req?: flow_devops_ob_query_telemetry.GetTracesMetaInfoRequest,
options?: T,
): Promise<flow_devops_ob_query_telemetry.GetTracesMetaInfoResponse> {
const url = this.genBaseURL('/api/devops/ob_query/v1/traces/meta_info');
const method = 'GET';
return this.request({ url, method }, options);
}
/**
* GET /api/devops/ob_query/v1/trace/by_log_id
*
* 通过log ID查询链路详情
*/
GetTraceByLogID(
req: flow_devops_ob_query_telemetry.GetTraceByLogIDRequest,
options?: T,
): Promise<flow_devops_ob_query_telemetry.GetTraceByLogIDResponse> {
const _req = req;
const url = this.genBaseURL('/api/devops/ob_query/v1/trace/by_log_id');
const method = 'GET';
const params = {
space_id: _req['space_id'],
bot_id: _req['bot_id'],
log_id: _req['log_id'],
start_time: _req['start_time'],
end_time: _req['end_time'],
};
return this.request({ url, method, params }, options);
}
/**
* POST /api/devops/ob_query/v1/traces/batch_get_advance_info
*
* 批量查询链路进阶信息
*/
BatchGetTracesAdvanceInfo(
req: flow_devops_ob_query_telemetry.BatchGetTracesAdvanceInfoRequest,
options?: T,
): Promise<flow_devops_ob_query_telemetry.BatchGetTracesAdvanceInfoResponse> {
const _req = req;
const url = this.genBaseURL(
'/api/devops/ob_query/v1/traces/batch_get_advance_info',
);
const method = 'POST';
const data = {
space_id: _req['space_id'],
bot_id: _req['bot_id'],
traces: _req['traces'],
};
return this.request({ url, method, data }, options);
}
/**
* GET /api/devops/ob_query/v1/trace/:trace_id
*
* 通过trace ID查询链路详情
*/
GetTrace(
req: flow_devops_ob_query_telemetry.GetTraceRequest,
options?: T,
): Promise<flow_devops_ob_query_telemetry.GetTraceResponse> {
const _req = req;
const url = this.genBaseURL(
`/api/devops/ob_query/v1/trace/${_req['trace_id']}`,
);
const method = 'GET';
const params = {
space_id: _req['space_id'],
bot_id: _req['bot_id'],
start_time: _req['start_time'],
end_time: _req['end_time'],
};
return this.request({ url, method, params }, options);
}
/**
* POST /api/devops/ob_query/v1/metrics
*
* 获取 metrics 详情
*/
GetMetrics(
req: flow_devops_ob_query_metrics.GetMetricsRequest,
options?: T,
): Promise<flow_devops_ob_query_metrics.GetMetricsResponse> {
const _req = req;
const url = this.genBaseURL('/api/devops/ob_query/v1/metrics');
const method = 'POST';
const data = {
space_id: _req['space_id'],
bot_id: _req['bot_id'],
start_time: _req['start_time'],
end_time: _req['end_time'],
metrics_type: _req['metrics_type'],
aggregate_type: _req['aggregate_type'],
tag_kvs: _req['tag_kvs'],
top_k: _req['top_k'],
};
return this.request({ url, method, data }, options);
}
/**
* POST /api/devops/ob_query/v1/metrics/tag_v/latest_options
*
* 获取运维指标维度的值的最新选项
*/
GetTagVLatestOptions(
req: flow_devops_ob_query_metrics.GetTagVLatestOptionsRequest,
options?: T,
): Promise<flow_devops_ob_query_metrics.GetTagVLatestOptionsResponse> {
const _req = req;
const url = this.genBaseURL(
'/api/devops/ob_query/v1/metrics/tag_v/latest_options',
);
const method = 'POST';
const data = {
space_id: _req['space_id'],
bot_id: _req['bot_id'],
tag_k: _req['tag_k'],
choices: _req['choices'],
};
return this.request({ url, method, data }, options);
}
/**
* POST /api/devops/ob_query/v1/metrics/tag_v/historical_options
*
* 获取运维指标维度的值的历史选项
*/
GetTagVHistoricalOptions(
req: flow_devops_ob_query_metrics.GetTagVHistoricalOptionsRequest,
options?: T,
): Promise<flow_devops_ob_query_metrics.GetTagVHistoricalOptionsResponse> {
const _req = req;
const url = this.genBaseURL(
'/api/devops/ob_query/v1/metrics/tag_v/historical_options',
);
const method = 'POST';
const data = {
space_id: _req['space_id'],
bot_id: _req['bot_id'],
tag_k: _req['tag_k'],
choices: _req['choices'],
start_time: _req['start_time'],
end_time: _req['end_time'],
metrics_type: _req['metrics_type'],
top_k: _req['top_k'],
};
return this.request({ url, method, data }, options);
}
/**
* GET /api/devops/ob_query/search_trace
*
* 通过 logID/traceID/messageID 查询 tracing 数据
*/
SearchTrace(
req?: ob_query_trace.SearchTraceRequest,
options?: T,
): Promise<ob_query_trace.SearchTraceResponse> {
const _req = req || {};
const url = this.genBaseURL('/api/devops/ob_query/search_trace');
const method = 'GET';
const params = {
tenant: _req['tenant'],
trace_id: _req['trace_id'],
log_id: _req['log_id'],
message_id: _req['message_id'],
start_at: _req['start_at'],
end_at: _req['end_at'],
tenant_level: _req['tenant_level'],
token: _req['token'],
Base: _req['Base'],
};
return this.request({ url, method, params }, options);
}
/**
* GET /api/devops/ob_query/get_trace_frontend
*
* 查询 tracing 数据,前端 SDK 专用
*/
GetTraceFrontend(
req?: ob_query_trace.GetTraceFrontendRequest,
options?: T,
): Promise<ob_query_trace.GetTraceFrontendResponse> {
const _req = req || {};
const url = this.genBaseURL('/api/devops/ob_query/get_trace_frontend');
const method = 'GET';
const params = {
trace_id: _req['trace_id'],
log_id: _req['log_id'],
scene: _req['scene'],
start_at: _req['start_at'],
end_at: _req['end_at'],
bot_id: _req['bot_id'],
space_id: _req['space_id'],
tenant: _req['tenant'],
Base: _req['Base'],
};
return this.request({ url, method, params }, options);
}
/**
* GET /api/devops/ob_query/list_debug_queries
*
* 调试Query List
*/
ListDebugQueries(
req: ob_query_trace.ListDebugQueriesRequest,
options?: T,
): Promise<ob_query_trace.ListDebugQueriesResponse> {
const _req = req;
const url = this.genBaseURL('/api/devops/ob_query/list_debug_queries');
const method = 'GET';
const params = {
startAtMS: _req['startAtMS'],
endAtMS: _req['endAtMS'],
spaceID: _req['spaceID'],
botID: _req['botID'],
status: _req['status'],
inputSearch: _req['inputSearch'],
limit: _req['limit'],
pageToken: _req['pageToken'],
Base: _req['Base'],
};
return this.request({ url, method, params }, options);
}
/**
* POST /api/devops/ob_query/query/list
*
* 查询 query 列表
*/
ListQuery(
req: flow_devops_ob_query_query.ListQueryRequest,
options?: T,
): Promise<flow_devops_ob_query_query.ListQueryResponse> {
const _req = req;
const url = this.genBaseURL('/api/devops/ob_query/query/list');
const method = 'POST';
const data = {
space_id: _req['space_id'],
bot_id: _req['bot_id'],
query_filter: _req['query_filter'],
limit: _req['limit'],
page_token: _req['page_token'],
};
return this.request({ url, method, data }, options);
}
/**
* GET /api/devops/ob_query/query/enums
*
* 获取 query 枚举选项
*/
GetQueryEnums(
req: flow_devops_ob_query_query.GetQueryEnumsRequest,
options?: T,
): Promise<flow_devops_ob_query_query.GetQueryEnumsResponse> {
const _req = req;
const url = this.genBaseURL('/api/devops/ob_query/query/enums');
const method = 'GET';
const params = { space_id: _req['space_id'], bot_id: _req['bot_id'] };
return this.request({ url, method, params }, options);
}
/**
* POST /api/devops/ob_query/query/export_to_csv
*
* 将 query 导出为csv
*/
ExportQueryToCsv(
req: flow_devops_ob_query_query.ExportQueryToCsvRequest,
options?: T,
): Promise<flow_devops_ob_query_query.ExportQueryToCsvResponse> {
const _req = req;
const url = this.genBaseURL('/api/devops/ob_query/query/export_to_csv');
const method = 'POST';
const data = {
space_id: _req['space_id'],
bot_id: _req['bot_id'],
query_filter: _req['query_filter'],
};
return this.request({ url, method, data }, options);
}
/**
* POST /api/devops/ob_query/query/stat
*
* query 的统计指标
*/
GetQueryStat(
req: flow_devops_ob_query_query.GetQueryStatRequest,
options?: T,
): Promise<flow_devops_ob_query_query.GetQueryStatResponse> {
const _req = req;
const url = this.genBaseURL('/api/devops/ob_query/query/stat');
const method = 'POST';
const data = {
space_id: _req['space_id'],
bot_id: _req['bot_id'],
query_filter: _req['query_filter'],
};
return this.request({ url, method, data }, options);
}
}
/* eslint-enable */

View File

@@ -0,0 +1,43 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
export type Int64 = string | number;
export interface Base {
LogID?: string;
Caller?: string;
Addr?: string;
Client?: string;
TrafficEnv?: TrafficEnv;
Extra?: Record<string, string>;
}
export interface BaseResp {
StatusMessage?: string;
StatusCode?: number;
Extra?: Record<string, string>;
}
export interface TrafficEnv {
Open?: boolean;
Env?: string;
}
/* eslint-enable */

View File

@@ -0,0 +1,160 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
export type Int64 = string | number;
export enum AggregationType {
/** 时间聚合类型 */
Minute = 1,
Hour = 2,
Day = 3,
Week = 4,
}
export enum AppType {
/** 不区分应用类型 */
All = 0,
PSM = 1,
CozeBot = 2,
PTaaS = 3,
Model = 4,
FornaxSaas = 5,
FornaxPrompt = 6,
}
/** 指标选项类型 */
export enum IndicatorOptionType {
Undefined = 0,
/** model唯一标识 */
ModelIdentification = 1,
/** prompt key */
PromptKey = 2,
}
export enum InsightIndicatorType {
/** 指标类型,持续补充 */
InsightIndicatorsToken = 1,
InsightIndicatorsInputToken = 2,
InsightIndicatorsOutputToken = 3,
InsightIndicatorsUserCount = 4,
InsightIndicatorsTraceCount = 5,
InsightIndicatorsMessageCount = 6,
InsightIndicatorsQPS = 7,
InsightIndicatorsQPSSuccess = 8,
InsightIndicatorsQPSFail = 9,
InsightIndicatorsSpanCount = 10,
InsightIndicatorsRootDurationP50 = 11,
InsightIndicatorsRootDurationP90 = 12,
InsightIndicatorsRootDurationP99 = 13,
InsightIndicatorsRootDurationAvg = 14,
InsightIndicatorsRootDurationMax = 15,
InsightIndicatorsRootDurationMin = 16,
InsightIndicatorsLLMDurationP50 = 17,
InsightIndicatorsLLMDurationP90 = 18,
InsightIndicatorsLLMDurationP99 = 19,
InsightIndicatorsLLMDurationAvg = 20,
InsightIndicatorsLLMDurationMax = 21,
InsightIndicatorsLLMDurationMin = 22,
InsightIndicatorsLatencyFirstRespP50 = 23,
InsightIndicatorsLatencyFirstRespP90 = 24,
InsightIndicatorsLatencyFirstRespP99 = 25,
InsightIndicatorsLatencyFirstRespAvg = 26,
InsightIndicatorsLatencyFirstRespMax = 27,
InsightIndicatorsLatencyFirstRespMin = 28,
InsightIndicatorsSuccessRate = 29,
InsightIndicatorsModelQPS = 30,
InsightIndicatorsModelQPSSuccess = 31,
InsightIndicatorsModelQPSFail = 32,
InsightIndicatorsModelSuccessRate = 33,
InsightIndicatorsModelTokenRateP50 = 34,
InsightIndicatorsModelTokenRateP90 = 35,
InsightIndicatorsModelTokenRateP99 = 36,
InsightIndicatorsModelTokenRateAvg = 37,
InsightIndicatorsModelTokenRateMax = 38,
InsightIndicatorsModelTokenRateMin = 39,
InsightIndicatorsPromptHubToken = 40,
InsightIndicatorsPromptHubInputToken = 41,
InsightIndicatorsPromptHubOutputToken = 42,
InsightIndicatorsModelCount = 43,
InsightIndicatorsSpanErrorCount = 44,
}
export enum OverviewIndicatorType {
/** 总览指标类型,持续补充 */
OverviewIndicatorsUsegeCount = 1,
OverviewIndicatorsModelErrorRate = 2,
OverviewIndicatorsErrorRate = 3,
OverviewIndicatorsModelDurationAvg = 4,
OverviewIndicatorsModelToken = 5,
}
export interface Indicator {
/** 指标点,用于展示成折线图,废弃 */
indicator_points: Array<IndicatorPoint>;
/** 指标累加值,总数 */
totals: string;
/** 多个观测对象的指标点,用于展示成多行折线图 */
multi_obs_objs_indicator_points?: Record<string, Array<IndicatorPoint>>;
}
export interface IndicatorPoint {
/** 指标名称 */
indicator_type: InsightIndicatorType;
/** 指标的值,整数或小数 */
indicator_value: string;
/** 指标的时间戳,毫秒 */
timestamp?: string;
}
export interface InsightIndicatorFilter {
/** 应用类型 */
app_type: AppType;
/** psm列表 */
psm?: Array<string>;
/** coze bot id列表 */
coze_bot_id?: Array<string>;
/** prompt key+version列表version为空代表不过滤version */
prompt_key_version?: Array<PromptKeyVersion>;
/** 是不是评测流量false:不是评测流量true:是评测流量,不填:不区分评测流量 */
is_evaluation?: boolean;
/** model唯一标识 列表来自于QueryIndicatorOptions接口 */
model_identification?: Array<string>;
}
export interface ObsObjMeta {
/** 展示名称比如bot_id对应的展示名称是bot_nameprompt和psm的展示名称是自己 */
show_name?: string;
}
export interface OverviewIndicator {
/** 总览指标名称 */
overview_indicator_type: OverviewIndicatorType;
/** 总览指标的值,整数或小数 */
overview_indicator_value?: string;
/** 总览指标的同比值 */
overview_indicator_yoy_value?: string;
}
export interface PromptKeyVersion {
prompt_key: string;
prompt_version?: Array<string>;
}
/* eslint-enable */

View File

@@ -0,0 +1,199 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
export type Int64 = string | number;
/** 聚合方式 */
export enum AggregateType {
Unknown = 1,
Avg = 2,
P50 = 3,
P99 = 4,
P999 = 5,
P90 = 6,
Sum = 7,
}
/** 降采样间隔 */
export enum DownsampleInterval {
Unknown = 1,
/** 30 second */
DI30S = 2,
/** 1 minute */
DI1M = 3,
/** 2 minute */
DI2M = 4,
/** 5 minute */
DI5M = 5,
/** 10 minute */
DI10M = 6,
/** 20 minute */
DI20M = 7,
/** 30 minute */
DI30M = 8,
}
/** 运维视图的类型 */
export enum MetricsType {
Unknown = 1,
/** 每秒收到的查询次数反映了该Bot的查询负载情况 */
BotQueryQPS = 2,
/** 查询成功率反映了Bot在当前负载下的稳定性 */
BotQuerySuccessRate = 3,
/** 从被Bot收到查询到返回第一条Tokens的时延反映了查询方可感知到的Bot响应速度 */
BotQueryLatencyFirstResp = 4,
/** 从Bot收到查询到返回全部Tokens的时延反映了Bot的整体性能 */
BotQueryLatency = 5,
/** 每秒的工作流调用次数,反映了工作流的负载情况 */
WorkflowRunQPS = 6,
/** 工作流的调用成功率,反映了该工作流在当前负载下稳定性 */
WorkflowRunSuccessRate = 7,
/** 反映了工作流的执行耗时 */
WorkflowRunLatency = 8,
/** 每秒的插件调用次数。反映了插件负载情况 */
PluginRunQPS = 9,
/** 插件的调用成功率,反映了插件在当前负载下的稳定性 */
PluginRunSuccessRate = 10,
/** 插件的响应时长,反映了插件的整体性能 */
PluginRunLatency = 11,
/** 每秒的代码对应函数片段的被调用次数。反映了执行负载 */
CodeRunQPS = 12,
/** 代码对应函数的调用成功率,反映了对应负载下的稳定性 */
CodeRunSuccessRate = 13,
/** 代码对应函数的执行耗时,反映了整体性能 */
CodeRunLatency = 14,
/** 每秒知识库的召回次数,反映了知识库的召回负载 */
KnowledgeRecallQPS = 15,
/** 知识库的每次召回的片段数量 */
KnowledgeRecallSegments = 16,
/** 知识库的召回成功率,反映了知识库在当前负载下的稳定性情况 */
KnowledgeRecallSuccessRate = 17,
/** 知识库的召回耗时,反映了知识库的召回性能 */
KnowledgeRecallLatency = 18,
/** 每秒大模型的调用次数,反映了大模型的调用负载 */
LLMQueryQPS = 19,
/** 大模型的调用成功率,反映了大模型在当前负载下的稳定性 */
LLMQuerySuccessRate = 20,
/** 大模型的响应时长,反映了大模型的整体性能 */
LLMQueryLatency = 21,
/** 大模型每秒返回的Token数量 */
LLMOutputTokensQPS = 22,
/** 每秒的hook调用次数。反映了hook负载情况 */
HookRunQPS = 23,
/** hook的调用成功率反映了hook在当前负载下的稳定性 */
HookRunSuccessRate = 24,
/** hook的平均耗时反映了hook的整体性能 */
HookRunLatency = 25,
}
export interface Curve {
tag_kvs: Record<string, string>;
points: Array<Point>;
}
export interface GetMetricsData {
curves: Array<Curve>;
/** 降采样间隔 */
interval: DownsampleInterval;
}
export interface GetMetricsRequest {
/** space id */
space_id: string;
/** bot id */
bot_id: string;
/** s */
start_time: string;
/** s, end_at >= start_at */
end_time: string;
metrics_type: MetricsType;
aggregate_type?: AggregateType;
tag_kvs?: Record<string, Array<string>>;
top_k?: number;
}
export interface GetMetricsResponse {
data: GetMetricsData;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
export interface GetTagVHistoricalOptionsData {
options: Array<TagVOption>;
}
export interface GetTagVHistoricalOptionsRequest {
/** space id */
space_id: string;
/** bot id */
bot_id: string;
tag_k: string;
choices?: Record<string, Array<string>>;
/** s */
start_time: string;
/** s, end_at >= start_at */
end_time: string;
metrics_type: MetricsType;
top_k?: number;
}
export interface GetTagVHistoricalOptionsResponse {
data: GetTagVHistoricalOptionsData;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
export interface GetTagVLatestOptionsData {
options: Array<TagVOption>;
}
export interface GetTagVLatestOptionsRequest {
/** space id */
space_id: string;
/** bot id */
bot_id: string;
tag_k: string;
choices?: Record<string, Array<string>>;
}
export interface GetTagVLatestOptionsResponse {
data: GetTagVLatestOptionsData;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
export interface Point {
x: Int64;
x_alias: string;
y: number;
}
export interface TagVOption {
key: string;
label: string;
}
/* eslint-enable */

View File

@@ -0,0 +1,206 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
export type Int64 = string | number;
export enum CalFieldStatus {
/** 字段计算中 */
CalFieldStatusNotReady = 0,
/** 字段生产完成,可展示 */
CalFieldStatusOK = 1,
}
export enum Status {
StatusSuccess = 0,
StatusFail = 1,
}
export interface ExportQueryToCsvRequest {
/** space id */
space_id: string;
/** bot id */
bot_id: string;
/** 筛选参数 */
query_filter?: QueryFilter;
}
export interface ExportQueryToCsvResponse {
body?: Blob;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
export interface GetQueryEnumsRequest {
/** space id */
space_id: Int64;
bot_id: Int64;
}
export interface GetQueryEnumsResponse {
intent?: Array<Intent>;
/** key: connector_id, value: connector_name */
connectors?: Array<KV>;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
export interface GetQueryStatData {
/** Trace总数量 */
total_count?: number;
/** 错误率例如0.3代表30% */
error_rate?: number;
/** 总tokens消耗 */
tokens?: Percentile;
/** 总时延 */
latency?: Percentile;
/** 首字符回复时延 */
latency_first_resp?: Percentile;
}
export interface GetQueryStatRequest {
/** space id */
space_id: string;
/** bot id */
bot_id: string;
query_filter?: QueryFilter;
}
export interface GetQueryStatResponse {
data: GetQueryStatData;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
export interface I64Range {
/** Greater Than or Equal (>=) */
gte?: Int64;
/** Less Than or Equal (<=) */
lte?: Int64;
}
export interface Intent {
key?: string;
value?: string;
children?: Array<Intent>;
}
export interface KV {
Key?: string;
Value?: string;
}
export interface ListQueryRequest {
/** space id */
space_id: string;
/** bot id */
bot_id: string;
/** 筛选参数 */
query_filter?: QueryFilter;
/** default 20 max 200 */
limit?: number;
/** 上次请求带过来的分页参数 */
page_token?: string;
}
export interface ListQueryResponse {
data: Array<QueryData>;
/** 下一页的分页token前端拉取下一页数据时回传 */
next_page_token: string;
/** 是否有更多数据 */
has_more: boolean;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
export interface Percentile {
p50?: number;
p99?: number;
}
export interface QueryData {
query_id?: string;
/** trace_id用于查询trace细节 */
trace_id?: string;
/** 状态 */
status?: Status;
/** 用户ID */
user_id?: string;
/** 对话ID */
message_id?: string;
/** 会话ID */
session_id?: string;
/** 用户输入 */
input?: string;
/** bot输出 */
output?: string;
/** 模型输入长度 */
input_tokens?: number;
/** 模型输出长度 */
output_tokens?: number;
/** 发起请求时间 */
start_time?: string;
/** 整体耗时 */
latency?: Int64;
/** 首token时延 */
latency_first_resp?: Int64;
/** 渠道名称 */
connector?: string;
/** 意图标签 */
intent?: string;
/** 意图字段生产状态 */
intent_status?: CalFieldStatus;
/** session字段生产状态 */
session_id_status?: CalFieldStatus;
/** 会话IDconnector platform上报原始值 */
conversation_id?: string;
}
export interface QueryFilter {
start_time?: TimeRange;
status?: Array<Status>;
user_ids?: Array<string>;
message_ids?: Array<string>;
session_ids?: Array<string>;
input?: string;
output?: string;
input_tokens?: I64Range;
output_tokens?: I64Range;
latency?: I64Range;
latency_first_resp?: I64Range;
connector_ids?: Array<string>;
second_class_intents?: Array<string>;
}
export interface TimeRange {
/** Greater Than or Equal (>=) ms */
gte?: string;
/** Less Than or Equal (<=) ms */
lte?: string;
}
/* eslint-enable */

View File

@@ -0,0 +1,241 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
import * as flow_devops_ob_query_telemetry_common from './flow_devops_ob_query_telemetry_common';
import * as flow_devops_ob_query_telemetry_field_filter from './flow_devops_ob_query_telemetry_field_filter';
import * as flow_devops_ob_query_telemetry_span from './flow_devops_ob_query_telemetry_span';
export type Int64 = string | number;
export interface BatchGetTracesAdvanceInfoData {
traces_advance_info: Array<TraceAdvanceInfo>;
}
export interface BatchGetTracesAdvanceInfoRequest {
space_id: string;
bot_id: string;
traces: Array<TraceQueryParams>;
}
export interface BatchGetTracesAdvanceInfoResponse {
data: BatchGetTracesAdvanceInfoData;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
export interface FieldMeta {
/** 字段类型 */
value_type: flow_devops_ob_query_telemetry_common.ValueType;
/** 支持的操作类型 */
filter_types: Array<flow_devops_ob_query_telemetry_field_filter.FieldFilterType>;
/** 支持的可选项 */
field_options?: flow_devops_ob_query_telemetry_field_filter.FieldOptions;
}
export interface GetTraceByLogIDRequest {
/** space id */
space_id: string;
/** bot id */
bot_id: string;
log_id: string;
/** ms, 如果未传默认向前搜索十分钟 */
start_time?: string;
/** ms, end_at >= start_at, 如果未传默认向后搜索十分钟 */
end_time?: string;
}
export interface GetTraceByLogIDResponse {
data: GetTraceData;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
export interface GetTraceData {
spans: Array<flow_devops_ob_query_telemetry_span.Span>;
}
export interface GetTraceRequest {
/** space id */
space_id: string;
/** bot id */
bot_id: string;
trace_id: string;
/** ms */
start_time: string;
/** ms, end_at >= start_at */
end_time: string;
}
export interface GetTraceResponse {
data: GetTraceData;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
export interface GetTracesMetaInfoData {
/** 字段元信息 */
field_metas: Record<string, FieldMeta>;
/** span分类, key是分类value是span type */
span_category: Partial<
Record<
flow_devops_ob_query_telemetry_span.SpanCategory,
Array<flow_devops_ob_query_telemetry_span.SpanType>
>
>;
}
export interface GetTracesMetaInfoRequest {}
export interface GetTracesMetaInfoResponse {
data?: GetTracesMetaInfoData;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code?: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg?: string;
}
export interface GetTracesStatData {
/** Trace总数量 */
total_count: number;
/** 错误率例如0.3代表30% */
error_rate: number;
/** 总tokens消耗 */
tokens: MetricsValue;
/** 总时延 */
latency: MetricsValue;
/** 首字符回复时延 */
latency_first_resp: MetricsValue;
}
export interface GetTracesStatRequest {
space_id: string;
bot_id: string;
/** ms */
start_time: string;
/** ms, end_at >= start_at */
end_time: string;
}
export interface GetTracesStatResponse {
data: GetTracesStatData;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
export interface ListTracesData {
spans: Array<flow_devops_ob_query_telemetry_span.Span>;
/** 下一页的分页token前端拉取下一页数据时回传。 */
next_page_token: string;
/** 是否有更多数据 */
has_more: boolean;
}
export interface ListTracesRequest {
/** space id */
space_id: string;
/** bot id */
bot_id: string;
/** ms */
start_time: string;
/** ms, end_at >= start_at */
end_time: string;
/** Example:
filter 1000 <= sum(input_tokens) <= 2000
{
"filters": {
"input_tokens": {
"i64": {
"gte": 1000,
"lte": 2000,
}
}
}
} */
filters: Record<
string,
flow_devops_ob_query_telemetry_field_filter.FieldFilter
>;
/** Full-Text search 全文本搜索会搜input、output、bot_version, os_version这四个字段。可以传入多个关键词每个关键词之间是and关系 */
full_text_search?: Array<string>;
/** default 1000 */
limit?: number;
/** The ORDER BY is used to sort the records, in ascending or descending order.
ORDER BY with multiple field: The system will sort the results by field1(order_by[0]), then by field2(order_by[1])
⚠️ WARNING: only support start_time
Example:
[
{
"field_name": "start_time",
"order_type": "desc"
}
] */
order_by?: Array<flow_devops_ob_query_telemetry_common.OrderBy>;
/** The page token is generated after the first query and passed in the subsequent queries
to determine the starting point for the next page of results. */
page_token?: string;
}
export interface ListTracesResponse {
data: ListTracesData;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
/** 度量百分位数 */
export interface MetricsValue {
p50?: number;
p90?: number;
}
export interface TokenCost {
/** 输入消耗token数 */
input: number;
/** 输出消耗token数 */
output: number;
}
export interface TraceAdvanceInfo {
trace_id: string;
tokens: TokenCost;
status: flow_devops_ob_query_telemetry_span.SpanStatus;
}
/** Trace查询参数 */
export interface TraceQueryParams {
trace_id: string;
start_time: string;
end_time: string;
}
/* eslint-enable */

View File

@@ -0,0 +1,43 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
export type Int64 = string | number;
export enum OrderType {
Unknown = 1,
Desc = 2,
}
/** ValueType is used to represent any type of attribute value. */
export enum ValueType {
Unknown = 1,
Bool = 2,
I32 = 3,
I64 = 4,
F64 = 5,
String = 6,
}
export interface OrderBy {
field_name?: string;
order_type?: OrderType;
}
/* eslint-enable */

View File

@@ -0,0 +1,196 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
export type Int64 = string | number;
export enum FieldFilterType {
Unknown = 1,
/** Equals (=) */
Eq = 2,
/** Greater Than or Equal (>=) */
Gte = 3,
/** Less Than or Equal (<=) */
Lte = 4,
/** Contains All */
Containsall = 5,
/** In */
In = 6,
/** Not In */
NotIn = 7,
}
/** Syntax:
<fieldName>: {
"i64": {
"gte": <value>,
"lte": <value>
}
} */
export interface FieldFilter {
bool?: FieldFilterBool;
i32?: FieldFilterI32;
i64?: FieldFilterI64;
f64?: FieldFilterF64;
string?: FieldFilterString;
}
/** applied on a bool field
Syntax:
"bool": {
"eq": <value>
}
Example:
"bool": {"eq": true} */
export interface FieldFilterBool {
/** Equals (=)
The eq operator matches records where the value of a field equals the specified value. */
eq?: boolean;
}
/** applied on a float64 field
Syntax:
"f64": {
"gte": <value>,
"lte": <value>
}
Example:
"f64": {"gte": 100.0, "lte": 500.0} */
export interface FieldFilterF64 {
/** Greater Than or Equal (>=)
It selects those records where the value of the field is greater than or equal to (i.e. >=) the specified value. */
gte?: number;
/** Less Than or Equal (<=)
It selects those records where the value of the field is less than or equal to (i.e. <=) the specified value. */
lte?: number;
/** In
It selects those records where the value of the field is within the specified list of values.
The "In" operator is used to compare the field's value against an array of values, and if the field's value
is found within that array, the record is included in the result set. */
in?: Array<number>;
/** Not In
It selects those records where the value of the field is not within the specified list of values.
The "Not In" operator is used to compare the field's value against an array of values, and if the field's value
is not found within that array, the record is included in the result set. */
not_in?: Array<number>;
}
/** applied on a int32 field
Syntax:
"i64": {
"gte": <value>,
"lte": <value>
}
Example:
"i32": {"gte": 100, "lte": 1000} */
export interface FieldFilterI32 {
/** Greater Than or Equal (>=)
It selects those records where the value of the field is greater than or equal to (i.e. >=) the specified value. */
gte?: number;
/** Less Than or Equal (<=)
It selects those records where the value of the field is less than or equal to (i.e. <=) the specified value. */
lte?: number;
/** In
It selects those records where the value of the field is within the specified list of values.
The "In" operator is used to compare the field's value against an array of values, and if the field's value
is found within that array, the record is included in the result set. */
in?: Array<number>;
/** Not In
It selects those records where the value of the field is not within the specified list of values.
The "Not In" operator is used to compare the field's value against an array of values, and if the field's value
is not found within that array, the record is included in the result set. */
not_in?: Array<number>;
}
/** applied on a int64 field
Syntax:
"i64": {
"gte": <value>,
"lte": <value>
}
Example:
"i64": {"gte": 100, "lte": 1000} */
export interface FieldFilterI64 {
/** Greater Than or Equal (>=)
It selects those records where the value of the field is greater than or equal to (i.e. >=) the specified value. */
gte?: string;
/** Less Than or Equal (<=)
It selects those records where the value of the field is less than or equal to (i.e. <=) the specified value. */
lte?: string;
/** In
It selects those records where the value of the field is within the specified list of values.
The "In" operator is used to compare the field's value against an array of values, and if the field's value
is found within that array, the record is included in the result set. */
in?: Array<string>;
/** Not In
It selects those records where the value of the field is not within the specified list of values.
The "Not In" operator is used to compare the field's value against an array of values, and if the field's value
is not found within that array, the record is included in the result set. */
not_in?: Array<string>;
}
/** applied on a string field
Syntax:
"string": {
"containsall": [<value>]
}
Example:
"string": {"containsall": ["kid"]}
Only one of the following filtering operators can be selected */
export interface FieldFilterString {
/** Contains All
It selects those records where the value of the field contains all of the characters in the specified array. */
containsall?: Array<string>;
/** In
It selects those records where the value of the field is within the specified list of values.
The "In" operator is used to compare the field's value against an array of values, and if the field's value
is found within that array, the record is included in the result set.
If you want to match an empty string, pass in "" in the array and cannot pass in other strings at the same time */
in?: Array<string>;
/** Not In
It selects those records where the value of the field is not within the specified list of values.
The "Not In" operator is used to compare the field's value against an array of values, and if the field's value
is not found within that array, the record is included in the result set.
If you want to match a non empty string, pass in "" in the array and cannot pass in other strings at the same time */
not_in?: Array<string>;
}
export interface FieldOptions {
i32?: Array<number>;
i64?: Array<string>;
f64?: Array<number>;
string?: Array<string>;
}
/* eslint-enable */

View File

@@ -0,0 +1,141 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
import * as base from './base';
export type Int64 = string | number;
export enum QueryTypeEnum {
Undefined = 0,
Match = 1,
Term = 2,
Range = 3,
Exist = 4,
NotExist = 5,
}
export enum TagType {
STRING = 0,
DOUBLE = 1,
BOOL = 2,
LONG = 3,
BYTES = 4,
}
export interface Event {
type?: string;
name?: string;
tags?: Array<Tag>;
start_time?: Int64;
data?: Blob;
}
export interface FilterTag {
data_type?: string;
tag_key?: string;
multi_tag_keys?: Array<string>;
values?: Array<string>;
query_type?: QueryTypeEnum;
}
export interface ListSpansData {
spans?: Array<Span>;
context?: string;
}
export interface ListSpansRequest {
tenant?: string;
filter_tags?: Array<FilterTag>;
start_at: Int64;
end_at: Int64;
limit?: number;
desc_by_start_time?: boolean;
/** 检索游标 */
context?: string;
bot_id?: string;
workspace_id?: string;
Base?: base.Base;
}
export interface ListSpansResponse {
code: number;
msg: string;
data: ListSpansData;
BaseResp?: base.BaseResp;
}
export interface QueryTraceData {
spans?: Array<Span>;
}
export interface QueryTraceRequest {
tenant?: string;
trace_id?: string;
log_id?: string;
message_id?: string;
start_at?: Int64;
end_at?: Int64;
bot_id?: string;
workspace_id?: string;
Base?: base.Base;
}
export interface QueryTraceResponse {
code: number;
msg: string;
data: QueryTraceData;
BaseResp?: base.BaseResp;
}
export interface Span {
trace_id?: string;
log_id?: string;
psm?: string;
dc?: string;
pod_name?: string;
method?: string;
span_id?: string;
type?: string;
name?: string;
parent_id?: string;
events?: Array<Event>;
duration?: Int64;
start_time?: Int64;
status_code?: number;
from_service?: string;
tags?: Array<Tag>;
}
/** Tag */
export interface Tag {
key?: string;
tag_type?: TagType;
value?: Value;
}
export interface Value {
v_str?: string;
v_double?: number;
v_bool?: boolean;
v_long?: Int64;
v_bytes?: Blob;
}
/* eslint-enable */

View File

@@ -0,0 +1,350 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
import * as base from './base';
import * as flow_devops_ob_query_telemetry_span from './flow_devops_ob_query_telemetry_span';
import * as flow_devops_ob_query_telemetry from './flow_devops_ob_query_telemetry';
export type Int64 = string | number;
export enum CozeChannel {
/** 默认为Coze, 未来扩展到其他渠道 */
Coze = 0,
}
export enum DebugScene {
/** 默认play ground Debug场景 */
Debug = 0,
}
export enum FrontedTagType {
/** 文本 */
TEXT = 0,
/** 时间,用时间戳,单位是毫秒 */
TIME = 1,
/** 时间间隔,单位是毫秒 */
TIME_DURATION = 2,
}
export enum InputOutputType {
/** 文本类型 */
TEXT = 0,
}
export enum QueryScene {
/** doubao cici 全链路调试台 */
ALICE_OP = 0,
/** doubao cici debug 功能 */
DOUBAO_CICI_DEBUG = 1,
/** workflow debug 功能 */
WORKFLOW_DEBUG = 2,
/** Bots 运营后台 */
COZE_OP = 3,
/** fornax platform */
FORNAX = 4,
}
export enum QueryTypeEnum {
Undefined = 0,
Match = 1,
Term = 2,
Range = 3,
Exist = 4,
NotExist = 5,
NotIn = 6,
}
export enum TagType {
STRING = 0,
DOUBLE = 1,
BOOL = 2,
LONG = 3,
BYTES = 4,
}
export enum TenantLevel {
Ordinary = 0,
AdvancedWhitelist = 1,
DoubaoTransfer = 2,
DoubaoUnencrypted = 3,
}
export interface FilterTag {
data_type?: string;
tag_key?: string;
multi_tag_keys?: Array<string>;
values?: Array<string>;
query_type?: QueryTypeEnum;
}
export interface FrontendTag {
key: string;
/** 多语,如无配置时值沿用 key */
key_alias?: string;
tag_type: TagType;
value?: Value;
/** 前端类型,用于前端处理 */
frontend_tag_type?: FrontedTagType;
/** 是否可复制 */
can_copy?: boolean;
}
export interface GetTraceFrontendRequest {
trace_id?: string;
log_id?: string;
/** 调用场景 */
scene?: QueryScene;
start_at?: Int64;
end_at?: Int64;
bot_id?: string;
space_id?: string;
/** 租户: flow, flow_vip */
tenant?: string;
Base?: base.Base;
}
export interface GetTraceFrontendResponse {
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
data?: TraceFrontend;
BaseResp?: base.BaseResp;
}
export interface KeyScene {
/** 场景,如"拆分搜索词"\"搜索" */
scene?: string;
/** 状态信息 */
status_message?: string;
system?: string;
/** 历史消息 */
history_messages?: Array<MessageItem>;
/** 输入 */
input?: KeySceneInput;
/** 输出 */
output?: KeySceneOutput;
/** 单位是毫秒 */
duration?: Int64;
/** 开始时间,用于排序,单位是毫秒 */
start_time?: Int64;
/** 子场景 */
sub_key_scenes?: Array<KeyScene>;
/** 键值对列表 */
key_values?: Array<KeyValue>;
/** 场景代码 */
scene_code?: string;
}
export interface KeySceneInput {
role?: string;
content_list?: Array<TraceSummaryContent>;
}
export interface KeySceneOutput {
role?: string;
content_list?: Array<TraceSummaryContent>;
}
export interface KeyValue {
key?: string;
value?: string;
}
export interface ListDebugQueriesRequest {
startAtMS: Int64;
endAtMS: Int64;
spaceID: Int64;
botID: Int64;
status?: Array<flow_devops_ob_query_telemetry_span.SpanStatus>;
inputSearch?: string;
limit?: number;
pageToken?: string;
Base?: base.Base;
}
export interface ListDebugQueriesResponse {
data: flow_devops_ob_query_telemetry.ListTracesData;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
code: number;
/** 仅供http请求使用; 内部RPC不予使用统一通过BaseResp获取Code和Msg */
msg: string;
}
export interface MessageItem {
/** 角色 */
role?: string;
/** 内容 */
content?: string;
}
export interface SearchTraceRequest {
/** 租户: doubao/cici/fornax/coze */
tenant?: string;
trace_id?: string;
log_id?: string;
message_id?: string;
start_at?: Int64;
end_at?: Int64;
tenant_level?: TenantLevel;
token?: string;
Base?: base.Base;
}
export interface SearchTraceResponse {
code: number;
msg: string;
data: TraceData;
BaseResp?: base.BaseResp;
}
export interface Span {
trace_id?: string;
log_id?: string;
psm?: string;
dc?: string;
pod_name?: string;
span_id?: string;
type?: string;
name?: string;
parent_id?: string;
/** 单位是毫秒 */
duration?: Int64;
/** 单位是毫秒 */
start_time?: Int64;
status_code?: number;
tags?: Array<Tag>;
}
export interface SpanInputOutput {
/** TEXT */
type?: InputOutputType;
content?: string;
/** 是否是加密状态 */
is_encrypted?: boolean;
}
export interface SpanSummary {
tags?: Array<FrontendTag>;
}
/** Tag */
export interface Tag {
key?: string;
tag_type?: TagType;
value?: Value;
}
export interface TraceData {
spans?: Array<Span>;
}
export interface TraceFrontend {
spans?: Array<TraceFrontendSpan>;
header?: TraceHeader;
}
export interface TraceFrontendDoubaoCiciDebug {
spans?: Array<TraceFrontendSpan>;
header?: TraceHeader;
summary?: TraceSummary;
}
export interface TraceFrontendSpan {
trace_id?: string;
log_id?: string;
span_id?: string;
type?: string;
name?: string;
alias_name?: string;
parent_id?: string;
/** 单位是毫秒 */
duration?: Int64;
/** 单位是毫秒 */
start_time?: Int64;
status_code?: number;
tags?: Array<Tag>;
/** 节点详情 */
summary?: SpanSummary;
input?: SpanInputOutput;
output?: SpanInputOutput;
/** 是否是入口节点 */
is_entry?: boolean;
/** 产品线 */
product_line?: string;
/** 是否是关键节点 */
is_key_span?: boolean;
/** 节点负责人列表, 邮箱前缀 */
owner_list?: Array<string>;
/** 节点详情文档 */
rundown_doc_url?: string;
/** 是否是加密状态 */
is_encrypted?: boolean;
}
export interface TraceHeader {
/** 单位是毫秒 */
duration?: Int64;
/** 输入消耗token数 */
tokens?: number;
status_code?: number;
tags?: Array<FrontendTag>;
/** 消息ID */
message_id?: string;
/** 单位是毫秒 */
start_time?: Int64;
}
export interface TraceSummary {
/** 一级 System 的文本 */
system?: string;
/** 一级历史消息 */
history_messages?: Array<MessageItem>;
key_scenes?: Array<KeyScene>;
/** 输入 */
input?: string;
/** 输出 */
output?: string;
/** 一级当前对话的耗时, 单位是毫秒 */
duration?: Int64;
/** 用户ID */
user_id?: string;
/** 一级KeyScene列表 */
top_level_key_scenes?: Array<KeyScene>;
/** 是否是加密状态 */
is_encrypted?: boolean;
}
export interface TraceSummaryContent {
/** 键 */
key?: string;
/** 内容 */
content?: string;
}
export interface Value {
v_str?: string;
v_double?: number;
v_bool?: boolean;
v_long?: Int64;
v_bytes?: Blob;
}
/* eslint-enable */