@agentmark-ai/api-types 0.4.0 → 0.5.0
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/types.d.ts +42 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -99,6 +99,42 @@ export interface ModelStats {
|
|
|
99
99
|
export interface ModelStatsResponse {
|
|
100
100
|
models: ModelStats[];
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Aggregates for one (promptName, commitSha) pair — the per-version metrics
|
|
104
|
+
* behind prompt-version trace linking. `commitSha` is `''` for spans ingested
|
|
105
|
+
* before version stamping (or from paths with no commit to stamp).
|
|
106
|
+
*/
|
|
107
|
+
export interface PromptVersionStats {
|
|
108
|
+
promptName: string;
|
|
109
|
+
commitSha: string;
|
|
110
|
+
requests: number;
|
|
111
|
+
errorCount: number;
|
|
112
|
+
errorRate: number;
|
|
113
|
+
cost: number;
|
|
114
|
+
tokens: number;
|
|
115
|
+
avgLatencyMs: number;
|
|
116
|
+
/** Average score across all scores attached to this version's traces; null when unscored. */
|
|
117
|
+
avgScore: number | null;
|
|
118
|
+
/** Number of score rows behind `avgScore`. */
|
|
119
|
+
scoreCount: number;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Parameters for the per-prompt-version stats query.
|
|
123
|
+
*/
|
|
124
|
+
export interface PromptVersionStatsParams {
|
|
125
|
+
/** Restrict to a single prompt name. Omit for all prompts. */
|
|
126
|
+
promptName?: string;
|
|
127
|
+
/** Max number of (prompt, version) rows returned. */
|
|
128
|
+
limit?: number;
|
|
129
|
+
/** Single-env scoping. Mirrors ScoresParams. Undefined = no env filter. */
|
|
130
|
+
env?: EnvironmentQueryScope;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Response for the per-prompt-version stats query.
|
|
134
|
+
*/
|
|
135
|
+
export interface PromptVersionStatsResponse {
|
|
136
|
+
versions: PromptVersionStats[];
|
|
137
|
+
}
|
|
102
138
|
/**
|
|
103
139
|
* A single ranking item for dimension-grouped queries.
|
|
104
140
|
* Used by getRankingData to return data grouped by any dimension
|
|
@@ -842,6 +878,12 @@ export interface IAnalyticsService {
|
|
|
842
878
|
getMetrics(ctx: TenantContext, dateRange: DateRange, filters?: AnalyticsFilter[], env?: EnvironmentQueryScope): Promise<MetricsResponse>;
|
|
843
879
|
getExtendedMetrics(ctx: TenantContext, dateRange: DateRange, env?: EnvironmentQueryScope): Promise<ExtendedMetricsResponse>;
|
|
844
880
|
getModelStats(ctx: TenantContext, dateRange: DateRange, limit?: number, filters?: AnalyticsFilter[], env?: EnvironmentQueryScope): Promise<ModelStatsResponse>;
|
|
881
|
+
/**
|
|
882
|
+
* Per (promptName, commitSha) aggregates — prompt-version trace linking.
|
|
883
|
+
* Optional so existing implementers (e.g. the CLI's local service) remain
|
|
884
|
+
* source-compatible; the cloud AnalyticsService implements it.
|
|
885
|
+
*/
|
|
886
|
+
getPromptVersionStats?(ctx: TenantContext, dateRange: DateRange, params?: PromptVersionStatsParams): Promise<PromptVersionStatsResponse>;
|
|
845
887
|
getTraces(ctx: TenantContext, params: TracesParams): Promise<TracesResponse>;
|
|
846
888
|
getTraceDetail(ctx: TenantContext, traceId: string, env?: EnvironmentQueryScope): Promise<TraceDetail | null>;
|
|
847
889
|
getTraceDetailLightweight(ctx: TenantContext, traceId: string, env?: EnvironmentQueryScope): Promise<TraceDetail | null>;
|