@miradorlabs/web-grpc 4.31.0 → 4.32.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/package.json
CHANGED
|
@@ -3256,6 +3256,68 @@ export interface SessionGitBucket {
|
|
|
3256
3256
|
count: number;
|
|
3257
3257
|
}
|
|
3258
3258
|
|
|
3259
|
+
export interface GetSessionTotalsTrendRequest {
|
|
3260
|
+
organizationId: string;
|
|
3261
|
+
projectId: string;
|
|
3262
|
+
/**
|
|
3263
|
+
* The window's start, which is this request's scope (it has no filter): the sessions last active at or after it,
|
|
3264
|
+
* the set ListSessions keeps for the same filter.active_after. At most 35 days before the server's clock, else
|
|
3265
|
+
* INVALID_ARGUMENT; a start in the future answers no buckets.
|
|
3266
|
+
*/
|
|
3267
|
+
activeAfter:
|
|
3268
|
+
| Date
|
|
3269
|
+
| undefined;
|
|
3270
|
+
/**
|
|
3271
|
+
* Bucket width: ANALYTICS_TIME_INTERVAL_1_HOUR (a clock hour in time_zone) or ANALYTICS_TIME_INTERVAL_1_DAY (a
|
|
3272
|
+
* calendar day in time_zone). This RPC derives none: unspecified and every other value are INVALID_ARGUMENT.
|
|
3273
|
+
*/
|
|
3274
|
+
timeInterval: AnalyticsTimeInterval;
|
|
3275
|
+
/**
|
|
3276
|
+
* IANA zone name the buckets start in (e.g. "America/New_York"); empty is "UTC". Any other name is
|
|
3277
|
+
* INVALID_ARGUMENT. Echoed on the response.
|
|
3278
|
+
*/
|
|
3279
|
+
timeZone: string;
|
|
3280
|
+
}
|
|
3281
|
+
|
|
3282
|
+
export interface GetSessionTotalsTrendResponse {
|
|
3283
|
+
status:
|
|
3284
|
+
| ResponseStatus
|
|
3285
|
+
| undefined;
|
|
3286
|
+
/**
|
|
3287
|
+
* One row per (bucket, source system) with at least one session, ordered by bucket_start then source_system. A
|
|
3288
|
+
* bucket or source with no session has no row, so no rows means no session was last active in the window.
|
|
3289
|
+
*/
|
|
3290
|
+
buckets: SessionTotalsBucket[];
|
|
3291
|
+
/** The resolved IANA zone the buckets start in ("UTC" when the request named none). */
|
|
3292
|
+
timeZone: string;
|
|
3293
|
+
}
|
|
3294
|
+
|
|
3295
|
+
/**
|
|
3296
|
+
* SessionTotalsBucket is one source system's sessions whose last activity fell in one bucket, with their
|
|
3297
|
+
* whole-session totals. input_tokens is cache-inclusive. A source that reports no usage has zero tokens and cost
|
|
3298
|
+
* here: unknown, not none, which the caller decides by source, as for AISessionSummary.usage.
|
|
3299
|
+
*/
|
|
3300
|
+
export interface SessionTotalsBucket {
|
|
3301
|
+
/**
|
|
3302
|
+
* The instant the hour or calendar day holding the sessions' last activity starts in the response's time_zone.
|
|
3303
|
+
* Across a daylight-saving change a day is 23 or 25 hours long.
|
|
3304
|
+
*/
|
|
3305
|
+
bucketStart: Date | undefined;
|
|
3306
|
+
sourceSystem: string;
|
|
3307
|
+
/**
|
|
3308
|
+
* Sessions as ListSessions lists them, one per (source_system, session_id): over all rows they add up to
|
|
3309
|
+
* ListSessions' pagination.total_count for the same filter.active_after.
|
|
3310
|
+
*/
|
|
3311
|
+
sessions: number;
|
|
3312
|
+
modelCalls: number;
|
|
3313
|
+
inputTokens: number;
|
|
3314
|
+
outputTokens: number;
|
|
3315
|
+
/** AITokenUsage.provider_cost_usd, summed. */
|
|
3316
|
+
providerCostUsd: number;
|
|
3317
|
+
/** AIFacilityCostBreakdown.subscription_facility_usd, summed: a facility lens, never reconciled billing. */
|
|
3318
|
+
subscriptionFacilityUsd: number;
|
|
3319
|
+
}
|
|
3320
|
+
|
|
3259
3321
|
export interface GetSessionAnalysisRequest {
|
|
3260
3322
|
organizationId: string;
|
|
3261
3323
|
projectId: string;
|
|
@@ -23656,6 +23718,488 @@ export const SessionGitBucket: MessageFns<SessionGitBucket> = {
|
|
|
23656
23718
|
},
|
|
23657
23719
|
};
|
|
23658
23720
|
|
|
23721
|
+
function createBaseGetSessionTotalsTrendRequest(): GetSessionTotalsTrendRequest {
|
|
23722
|
+
return { organizationId: "", projectId: "", activeAfter: undefined, timeInterval: 0, timeZone: "" };
|
|
23723
|
+
}
|
|
23724
|
+
|
|
23725
|
+
export const GetSessionTotalsTrendRequest: MessageFns<GetSessionTotalsTrendRequest> = {
|
|
23726
|
+
encode(message: GetSessionTotalsTrendRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
23727
|
+
if (message.organizationId !== "") {
|
|
23728
|
+
writer.uint32(10).string(message.organizationId);
|
|
23729
|
+
}
|
|
23730
|
+
if (message.projectId !== "") {
|
|
23731
|
+
writer.uint32(18).string(message.projectId);
|
|
23732
|
+
}
|
|
23733
|
+
if (message.activeAfter !== undefined) {
|
|
23734
|
+
Timestamp.encode(toTimestamp(message.activeAfter), writer.uint32(26).fork()).join();
|
|
23735
|
+
}
|
|
23736
|
+
if (message.timeInterval !== 0) {
|
|
23737
|
+
writer.uint32(32).int32(message.timeInterval);
|
|
23738
|
+
}
|
|
23739
|
+
if (message.timeZone !== "") {
|
|
23740
|
+
writer.uint32(42).string(message.timeZone);
|
|
23741
|
+
}
|
|
23742
|
+
return writer;
|
|
23743
|
+
},
|
|
23744
|
+
|
|
23745
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetSessionTotalsTrendRequest {
|
|
23746
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
23747
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
23748
|
+
if (previousRecursionDepth >= 100) {
|
|
23749
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
23750
|
+
}
|
|
23751
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
23752
|
+
try {
|
|
23753
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
23754
|
+
const message = createBaseGetSessionTotalsTrendRequest();
|
|
23755
|
+
while (reader.pos < end) {
|
|
23756
|
+
const tag = reader.uint32();
|
|
23757
|
+
switch (tag >>> 3) {
|
|
23758
|
+
case 1: {
|
|
23759
|
+
if (tag !== 10) {
|
|
23760
|
+
break;
|
|
23761
|
+
}
|
|
23762
|
+
|
|
23763
|
+
message.organizationId = reader.string();
|
|
23764
|
+
continue;
|
|
23765
|
+
}
|
|
23766
|
+
case 2: {
|
|
23767
|
+
if (tag !== 18) {
|
|
23768
|
+
break;
|
|
23769
|
+
}
|
|
23770
|
+
|
|
23771
|
+
message.projectId = reader.string();
|
|
23772
|
+
continue;
|
|
23773
|
+
}
|
|
23774
|
+
case 3: {
|
|
23775
|
+
if (tag !== 26) {
|
|
23776
|
+
break;
|
|
23777
|
+
}
|
|
23778
|
+
|
|
23779
|
+
message.activeAfter = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
23780
|
+
continue;
|
|
23781
|
+
}
|
|
23782
|
+
case 4: {
|
|
23783
|
+
if (tag !== 32) {
|
|
23784
|
+
break;
|
|
23785
|
+
}
|
|
23786
|
+
|
|
23787
|
+
message.timeInterval = reader.int32() as any;
|
|
23788
|
+
continue;
|
|
23789
|
+
}
|
|
23790
|
+
case 5: {
|
|
23791
|
+
if (tag !== 42) {
|
|
23792
|
+
break;
|
|
23793
|
+
}
|
|
23794
|
+
|
|
23795
|
+
message.timeZone = reader.string();
|
|
23796
|
+
continue;
|
|
23797
|
+
}
|
|
23798
|
+
}
|
|
23799
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
23800
|
+
break;
|
|
23801
|
+
}
|
|
23802
|
+
reader.skip(tag & 7);
|
|
23803
|
+
}
|
|
23804
|
+
return message;
|
|
23805
|
+
} finally {
|
|
23806
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
23807
|
+
}
|
|
23808
|
+
},
|
|
23809
|
+
|
|
23810
|
+
fromJSON(object: any): GetSessionTotalsTrendRequest {
|
|
23811
|
+
return {
|
|
23812
|
+
organizationId: isSet(object.organizationId)
|
|
23813
|
+
? globalThis.String(object.organizationId)
|
|
23814
|
+
: isSet(object.organization_id)
|
|
23815
|
+
? globalThis.String(object.organization_id)
|
|
23816
|
+
: "",
|
|
23817
|
+
projectId: isSet(object.projectId)
|
|
23818
|
+
? globalThis.String(object.projectId)
|
|
23819
|
+
: isSet(object.project_id)
|
|
23820
|
+
? globalThis.String(object.project_id)
|
|
23821
|
+
: "",
|
|
23822
|
+
activeAfter: isSet(object.activeAfter)
|
|
23823
|
+
? fromJsonTimestamp(object.activeAfter)
|
|
23824
|
+
: isSet(object.active_after)
|
|
23825
|
+
? fromJsonTimestamp(object.active_after)
|
|
23826
|
+
: undefined,
|
|
23827
|
+
timeInterval: isSet(object.timeInterval)
|
|
23828
|
+
? analyticsTimeIntervalFromJSON(object.timeInterval)
|
|
23829
|
+
: isSet(object.time_interval)
|
|
23830
|
+
? analyticsTimeIntervalFromJSON(object.time_interval)
|
|
23831
|
+
: 0,
|
|
23832
|
+
timeZone: isSet(object.timeZone)
|
|
23833
|
+
? globalThis.String(object.timeZone)
|
|
23834
|
+
: isSet(object.time_zone)
|
|
23835
|
+
? globalThis.String(object.time_zone)
|
|
23836
|
+
: "",
|
|
23837
|
+
};
|
|
23838
|
+
},
|
|
23839
|
+
|
|
23840
|
+
toJSON(message: GetSessionTotalsTrendRequest): unknown {
|
|
23841
|
+
const obj: any = {};
|
|
23842
|
+
if (message.organizationId !== "") {
|
|
23843
|
+
obj.organizationId = message.organizationId;
|
|
23844
|
+
}
|
|
23845
|
+
if (message.projectId !== "") {
|
|
23846
|
+
obj.projectId = message.projectId;
|
|
23847
|
+
}
|
|
23848
|
+
if (message.activeAfter !== undefined) {
|
|
23849
|
+
obj.activeAfter = message.activeAfter.toISOString();
|
|
23850
|
+
}
|
|
23851
|
+
if (message.timeInterval !== 0) {
|
|
23852
|
+
obj.timeInterval = analyticsTimeIntervalToJSON(message.timeInterval);
|
|
23853
|
+
}
|
|
23854
|
+
if (message.timeZone !== "") {
|
|
23855
|
+
obj.timeZone = message.timeZone;
|
|
23856
|
+
}
|
|
23857
|
+
return obj;
|
|
23858
|
+
},
|
|
23859
|
+
|
|
23860
|
+
create<I extends Exact<DeepPartial<GetSessionTotalsTrendRequest>, I>>(base?: I): GetSessionTotalsTrendRequest {
|
|
23861
|
+
return GetSessionTotalsTrendRequest.fromPartial(base ?? ({} as any));
|
|
23862
|
+
},
|
|
23863
|
+
fromPartial<I extends Exact<DeepPartial<GetSessionTotalsTrendRequest>, I>>(object: I): GetSessionTotalsTrendRequest {
|
|
23864
|
+
const message = createBaseGetSessionTotalsTrendRequest();
|
|
23865
|
+
message.organizationId = object.organizationId ?? "";
|
|
23866
|
+
message.projectId = object.projectId ?? "";
|
|
23867
|
+
message.activeAfter = object.activeAfter ?? undefined;
|
|
23868
|
+
message.timeInterval = object.timeInterval ?? 0;
|
|
23869
|
+
message.timeZone = object.timeZone ?? "";
|
|
23870
|
+
return message;
|
|
23871
|
+
},
|
|
23872
|
+
};
|
|
23873
|
+
|
|
23874
|
+
function createBaseGetSessionTotalsTrendResponse(): GetSessionTotalsTrendResponse {
|
|
23875
|
+
return { status: undefined, buckets: [], timeZone: "" };
|
|
23876
|
+
}
|
|
23877
|
+
|
|
23878
|
+
export const GetSessionTotalsTrendResponse: MessageFns<GetSessionTotalsTrendResponse> = {
|
|
23879
|
+
encode(message: GetSessionTotalsTrendResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
23880
|
+
if (message.status !== undefined) {
|
|
23881
|
+
ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
|
|
23882
|
+
}
|
|
23883
|
+
for (const v of message.buckets) {
|
|
23884
|
+
SessionTotalsBucket.encode(v!, writer.uint32(18).fork()).join();
|
|
23885
|
+
}
|
|
23886
|
+
if (message.timeZone !== "") {
|
|
23887
|
+
writer.uint32(26).string(message.timeZone);
|
|
23888
|
+
}
|
|
23889
|
+
return writer;
|
|
23890
|
+
},
|
|
23891
|
+
|
|
23892
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetSessionTotalsTrendResponse {
|
|
23893
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
23894
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
23895
|
+
if (previousRecursionDepth >= 100) {
|
|
23896
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
23897
|
+
}
|
|
23898
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
23899
|
+
try {
|
|
23900
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
23901
|
+
const message = createBaseGetSessionTotalsTrendResponse();
|
|
23902
|
+
while (reader.pos < end) {
|
|
23903
|
+
const tag = reader.uint32();
|
|
23904
|
+
switch (tag >>> 3) {
|
|
23905
|
+
case 1: {
|
|
23906
|
+
if (tag !== 10) {
|
|
23907
|
+
break;
|
|
23908
|
+
}
|
|
23909
|
+
|
|
23910
|
+
message.status = ResponseStatus.decode(reader, reader.uint32());
|
|
23911
|
+
continue;
|
|
23912
|
+
}
|
|
23913
|
+
case 2: {
|
|
23914
|
+
if (tag !== 18) {
|
|
23915
|
+
break;
|
|
23916
|
+
}
|
|
23917
|
+
|
|
23918
|
+
message.buckets.push(SessionTotalsBucket.decode(reader, reader.uint32()));
|
|
23919
|
+
continue;
|
|
23920
|
+
}
|
|
23921
|
+
case 3: {
|
|
23922
|
+
if (tag !== 26) {
|
|
23923
|
+
break;
|
|
23924
|
+
}
|
|
23925
|
+
|
|
23926
|
+
message.timeZone = reader.string();
|
|
23927
|
+
continue;
|
|
23928
|
+
}
|
|
23929
|
+
}
|
|
23930
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
23931
|
+
break;
|
|
23932
|
+
}
|
|
23933
|
+
reader.skip(tag & 7);
|
|
23934
|
+
}
|
|
23935
|
+
return message;
|
|
23936
|
+
} finally {
|
|
23937
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
23938
|
+
}
|
|
23939
|
+
},
|
|
23940
|
+
|
|
23941
|
+
fromJSON(object: any): GetSessionTotalsTrendResponse {
|
|
23942
|
+
return {
|
|
23943
|
+
status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
|
|
23944
|
+
buckets: globalThis.Array.isArray(object?.buckets)
|
|
23945
|
+
? object.buckets.map((e: any) => SessionTotalsBucket.fromJSON(e))
|
|
23946
|
+
: [],
|
|
23947
|
+
timeZone: isSet(object.timeZone)
|
|
23948
|
+
? globalThis.String(object.timeZone)
|
|
23949
|
+
: isSet(object.time_zone)
|
|
23950
|
+
? globalThis.String(object.time_zone)
|
|
23951
|
+
: "",
|
|
23952
|
+
};
|
|
23953
|
+
},
|
|
23954
|
+
|
|
23955
|
+
toJSON(message: GetSessionTotalsTrendResponse): unknown {
|
|
23956
|
+
const obj: any = {};
|
|
23957
|
+
if (message.status !== undefined) {
|
|
23958
|
+
obj.status = ResponseStatus.toJSON(message.status);
|
|
23959
|
+
}
|
|
23960
|
+
if (message.buckets?.length) {
|
|
23961
|
+
obj.buckets = message.buckets.map((e) => SessionTotalsBucket.toJSON(e));
|
|
23962
|
+
}
|
|
23963
|
+
if (message.timeZone !== "") {
|
|
23964
|
+
obj.timeZone = message.timeZone;
|
|
23965
|
+
}
|
|
23966
|
+
return obj;
|
|
23967
|
+
},
|
|
23968
|
+
|
|
23969
|
+
create<I extends Exact<DeepPartial<GetSessionTotalsTrendResponse>, I>>(base?: I): GetSessionTotalsTrendResponse {
|
|
23970
|
+
return GetSessionTotalsTrendResponse.fromPartial(base ?? ({} as any));
|
|
23971
|
+
},
|
|
23972
|
+
fromPartial<I extends Exact<DeepPartial<GetSessionTotalsTrendResponse>, I>>(
|
|
23973
|
+
object: I,
|
|
23974
|
+
): GetSessionTotalsTrendResponse {
|
|
23975
|
+
const message = createBaseGetSessionTotalsTrendResponse();
|
|
23976
|
+
message.status = (object.status !== undefined && object.status !== null)
|
|
23977
|
+
? ResponseStatus.fromPartial(object.status)
|
|
23978
|
+
: undefined;
|
|
23979
|
+
message.buckets = object.buckets?.map((e) => SessionTotalsBucket.fromPartial(e)) || [];
|
|
23980
|
+
message.timeZone = object.timeZone ?? "";
|
|
23981
|
+
return message;
|
|
23982
|
+
},
|
|
23983
|
+
};
|
|
23984
|
+
|
|
23985
|
+
function createBaseSessionTotalsBucket(): SessionTotalsBucket {
|
|
23986
|
+
return {
|
|
23987
|
+
bucketStart: undefined,
|
|
23988
|
+
sourceSystem: "",
|
|
23989
|
+
sessions: 0,
|
|
23990
|
+
modelCalls: 0,
|
|
23991
|
+
inputTokens: 0,
|
|
23992
|
+
outputTokens: 0,
|
|
23993
|
+
providerCostUsd: 0,
|
|
23994
|
+
subscriptionFacilityUsd: 0,
|
|
23995
|
+
};
|
|
23996
|
+
}
|
|
23997
|
+
|
|
23998
|
+
export const SessionTotalsBucket: MessageFns<SessionTotalsBucket> = {
|
|
23999
|
+
encode(message: SessionTotalsBucket, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
24000
|
+
if (message.bucketStart !== undefined) {
|
|
24001
|
+
Timestamp.encode(toTimestamp(message.bucketStart), writer.uint32(10).fork()).join();
|
|
24002
|
+
}
|
|
24003
|
+
if (message.sourceSystem !== "") {
|
|
24004
|
+
writer.uint32(18).string(message.sourceSystem);
|
|
24005
|
+
}
|
|
24006
|
+
if (message.sessions !== 0) {
|
|
24007
|
+
writer.uint32(24).uint64(message.sessions);
|
|
24008
|
+
}
|
|
24009
|
+
if (message.modelCalls !== 0) {
|
|
24010
|
+
writer.uint32(32).uint64(message.modelCalls);
|
|
24011
|
+
}
|
|
24012
|
+
if (message.inputTokens !== 0) {
|
|
24013
|
+
writer.uint32(40).uint64(message.inputTokens);
|
|
24014
|
+
}
|
|
24015
|
+
if (message.outputTokens !== 0) {
|
|
24016
|
+
writer.uint32(48).uint64(message.outputTokens);
|
|
24017
|
+
}
|
|
24018
|
+
if (message.providerCostUsd !== 0) {
|
|
24019
|
+
writer.uint32(57).double(message.providerCostUsd);
|
|
24020
|
+
}
|
|
24021
|
+
if (message.subscriptionFacilityUsd !== 0) {
|
|
24022
|
+
writer.uint32(65).double(message.subscriptionFacilityUsd);
|
|
24023
|
+
}
|
|
24024
|
+
return writer;
|
|
24025
|
+
},
|
|
24026
|
+
|
|
24027
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SessionTotalsBucket {
|
|
24028
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
24029
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
24030
|
+
if (previousRecursionDepth >= 100) {
|
|
24031
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
24032
|
+
}
|
|
24033
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
24034
|
+
try {
|
|
24035
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
24036
|
+
const message = createBaseSessionTotalsBucket();
|
|
24037
|
+
while (reader.pos < end) {
|
|
24038
|
+
const tag = reader.uint32();
|
|
24039
|
+
switch (tag >>> 3) {
|
|
24040
|
+
case 1: {
|
|
24041
|
+
if (tag !== 10) {
|
|
24042
|
+
break;
|
|
24043
|
+
}
|
|
24044
|
+
|
|
24045
|
+
message.bucketStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
24046
|
+
continue;
|
|
24047
|
+
}
|
|
24048
|
+
case 2: {
|
|
24049
|
+
if (tag !== 18) {
|
|
24050
|
+
break;
|
|
24051
|
+
}
|
|
24052
|
+
|
|
24053
|
+
message.sourceSystem = reader.string();
|
|
24054
|
+
continue;
|
|
24055
|
+
}
|
|
24056
|
+
case 3: {
|
|
24057
|
+
if (tag !== 24) {
|
|
24058
|
+
break;
|
|
24059
|
+
}
|
|
24060
|
+
|
|
24061
|
+
message.sessions = longToNumber(reader.uint64());
|
|
24062
|
+
continue;
|
|
24063
|
+
}
|
|
24064
|
+
case 4: {
|
|
24065
|
+
if (tag !== 32) {
|
|
24066
|
+
break;
|
|
24067
|
+
}
|
|
24068
|
+
|
|
24069
|
+
message.modelCalls = longToNumber(reader.uint64());
|
|
24070
|
+
continue;
|
|
24071
|
+
}
|
|
24072
|
+
case 5: {
|
|
24073
|
+
if (tag !== 40) {
|
|
24074
|
+
break;
|
|
24075
|
+
}
|
|
24076
|
+
|
|
24077
|
+
message.inputTokens = longToNumber(reader.uint64());
|
|
24078
|
+
continue;
|
|
24079
|
+
}
|
|
24080
|
+
case 6: {
|
|
24081
|
+
if (tag !== 48) {
|
|
24082
|
+
break;
|
|
24083
|
+
}
|
|
24084
|
+
|
|
24085
|
+
message.outputTokens = longToNumber(reader.uint64());
|
|
24086
|
+
continue;
|
|
24087
|
+
}
|
|
24088
|
+
case 7: {
|
|
24089
|
+
if (tag !== 57) {
|
|
24090
|
+
break;
|
|
24091
|
+
}
|
|
24092
|
+
|
|
24093
|
+
message.providerCostUsd = reader.double();
|
|
24094
|
+
continue;
|
|
24095
|
+
}
|
|
24096
|
+
case 8: {
|
|
24097
|
+
if (tag !== 65) {
|
|
24098
|
+
break;
|
|
24099
|
+
}
|
|
24100
|
+
|
|
24101
|
+
message.subscriptionFacilityUsd = reader.double();
|
|
24102
|
+
continue;
|
|
24103
|
+
}
|
|
24104
|
+
}
|
|
24105
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
24106
|
+
break;
|
|
24107
|
+
}
|
|
24108
|
+
reader.skip(tag & 7);
|
|
24109
|
+
}
|
|
24110
|
+
return message;
|
|
24111
|
+
} finally {
|
|
24112
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
24113
|
+
}
|
|
24114
|
+
},
|
|
24115
|
+
|
|
24116
|
+
fromJSON(object: any): SessionTotalsBucket {
|
|
24117
|
+
return {
|
|
24118
|
+
bucketStart: isSet(object.bucketStart)
|
|
24119
|
+
? fromJsonTimestamp(object.bucketStart)
|
|
24120
|
+
: isSet(object.bucket_start)
|
|
24121
|
+
? fromJsonTimestamp(object.bucket_start)
|
|
24122
|
+
: undefined,
|
|
24123
|
+
sourceSystem: isSet(object.sourceSystem)
|
|
24124
|
+
? globalThis.String(object.sourceSystem)
|
|
24125
|
+
: isSet(object.source_system)
|
|
24126
|
+
? globalThis.String(object.source_system)
|
|
24127
|
+
: "",
|
|
24128
|
+
sessions: isSet(object.sessions) ? globalThis.Number(object.sessions) : 0,
|
|
24129
|
+
modelCalls: isSet(object.modelCalls)
|
|
24130
|
+
? globalThis.Number(object.modelCalls)
|
|
24131
|
+
: isSet(object.model_calls)
|
|
24132
|
+
? globalThis.Number(object.model_calls)
|
|
24133
|
+
: 0,
|
|
24134
|
+
inputTokens: isSet(object.inputTokens)
|
|
24135
|
+
? globalThis.Number(object.inputTokens)
|
|
24136
|
+
: isSet(object.input_tokens)
|
|
24137
|
+
? globalThis.Number(object.input_tokens)
|
|
24138
|
+
: 0,
|
|
24139
|
+
outputTokens: isSet(object.outputTokens)
|
|
24140
|
+
? globalThis.Number(object.outputTokens)
|
|
24141
|
+
: isSet(object.output_tokens)
|
|
24142
|
+
? globalThis.Number(object.output_tokens)
|
|
24143
|
+
: 0,
|
|
24144
|
+
providerCostUsd: isSet(object.providerCostUsd)
|
|
24145
|
+
? globalThis.Number(object.providerCostUsd)
|
|
24146
|
+
: isSet(object.provider_cost_usd)
|
|
24147
|
+
? globalThis.Number(object.provider_cost_usd)
|
|
24148
|
+
: 0,
|
|
24149
|
+
subscriptionFacilityUsd: isSet(object.subscriptionFacilityUsd)
|
|
24150
|
+
? globalThis.Number(object.subscriptionFacilityUsd)
|
|
24151
|
+
: isSet(object.subscription_facility_usd)
|
|
24152
|
+
? globalThis.Number(object.subscription_facility_usd)
|
|
24153
|
+
: 0,
|
|
24154
|
+
};
|
|
24155
|
+
},
|
|
24156
|
+
|
|
24157
|
+
toJSON(message: SessionTotalsBucket): unknown {
|
|
24158
|
+
const obj: any = {};
|
|
24159
|
+
if (message.bucketStart !== undefined) {
|
|
24160
|
+
obj.bucketStart = message.bucketStart.toISOString();
|
|
24161
|
+
}
|
|
24162
|
+
if (message.sourceSystem !== "") {
|
|
24163
|
+
obj.sourceSystem = message.sourceSystem;
|
|
24164
|
+
}
|
|
24165
|
+
if (message.sessions !== 0) {
|
|
24166
|
+
obj.sessions = Math.round(message.sessions);
|
|
24167
|
+
}
|
|
24168
|
+
if (message.modelCalls !== 0) {
|
|
24169
|
+
obj.modelCalls = Math.round(message.modelCalls);
|
|
24170
|
+
}
|
|
24171
|
+
if (message.inputTokens !== 0) {
|
|
24172
|
+
obj.inputTokens = Math.round(message.inputTokens);
|
|
24173
|
+
}
|
|
24174
|
+
if (message.outputTokens !== 0) {
|
|
24175
|
+
obj.outputTokens = Math.round(message.outputTokens);
|
|
24176
|
+
}
|
|
24177
|
+
if (message.providerCostUsd !== 0) {
|
|
24178
|
+
obj.providerCostUsd = floatToJson(message.providerCostUsd);
|
|
24179
|
+
}
|
|
24180
|
+
if (message.subscriptionFacilityUsd !== 0) {
|
|
24181
|
+
obj.subscriptionFacilityUsd = floatToJson(message.subscriptionFacilityUsd);
|
|
24182
|
+
}
|
|
24183
|
+
return obj;
|
|
24184
|
+
},
|
|
24185
|
+
|
|
24186
|
+
create<I extends Exact<DeepPartial<SessionTotalsBucket>, I>>(base?: I): SessionTotalsBucket {
|
|
24187
|
+
return SessionTotalsBucket.fromPartial(base ?? ({} as any));
|
|
24188
|
+
},
|
|
24189
|
+
fromPartial<I extends Exact<DeepPartial<SessionTotalsBucket>, I>>(object: I): SessionTotalsBucket {
|
|
24190
|
+
const message = createBaseSessionTotalsBucket();
|
|
24191
|
+
message.bucketStart = object.bucketStart ?? undefined;
|
|
24192
|
+
message.sourceSystem = object.sourceSystem ?? "";
|
|
24193
|
+
message.sessions = object.sessions ?? 0;
|
|
24194
|
+
message.modelCalls = object.modelCalls ?? 0;
|
|
24195
|
+
message.inputTokens = object.inputTokens ?? 0;
|
|
24196
|
+
message.outputTokens = object.outputTokens ?? 0;
|
|
24197
|
+
message.providerCostUsd = object.providerCostUsd ?? 0;
|
|
24198
|
+
message.subscriptionFacilityUsd = object.subscriptionFacilityUsd ?? 0;
|
|
24199
|
+
return message;
|
|
24200
|
+
},
|
|
24201
|
+
};
|
|
24202
|
+
|
|
23659
24203
|
function createBaseGetSessionAnalysisRequest(): GetSessionAnalysisRequest {
|
|
23660
24204
|
return { organizationId: "", projectId: "", sourceSystem: "", sessionId: "" };
|
|
23661
24205
|
}
|
|
@@ -35546,6 +36090,15 @@ export interface AIGatewayService {
|
|
|
35546
36090
|
* calls, tokens and cost, and each git action's count. Mirrors telemetry.api.v1.
|
|
35547
36091
|
*/
|
|
35548
36092
|
GetSessionUsageTrend(request: SessionUsageTrendRequest, metadata?: Metadata): Promise<SessionUsageTrendResponse>;
|
|
36093
|
+
/**
|
|
36094
|
+
* The sessions ListSessions lists with filter.active_after, per hour or calendar day of each session's last activity
|
|
36095
|
+
* and source system: how many sessions, and their whole-session model calls, tokens and cost. Each session's
|
|
36096
|
+
* lifetime totals land in the bucket of its last activity. Unpaged, bounded by its window. Mirrors ai.api.v1.
|
|
36097
|
+
*/
|
|
36098
|
+
GetSessionTotalsTrend(
|
|
36099
|
+
request: GetSessionTotalsTrendRequest,
|
|
36100
|
+
metadata?: Metadata,
|
|
36101
|
+
): Promise<GetSessionTotalsTrendResponse>;
|
|
35549
36102
|
/**
|
|
35550
36103
|
* One session's latest score against the scorer's rubric, with each criterion's assessment and improvement, and
|
|
35551
36104
|
* its latest insights with their cause and action; each part absent until its job has run. Mirrors ai.api.v1.
|
|
@@ -35684,6 +36237,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
|
|
|
35684
36237
|
this.GetReasoningTrendContribution = this.GetReasoningTrendContribution.bind(this);
|
|
35685
36238
|
this.SetReasoningTrendContribution = this.SetReasoningTrendContribution.bind(this);
|
|
35686
36239
|
this.GetSessionUsageTrend = this.GetSessionUsageTrend.bind(this);
|
|
36240
|
+
this.GetSessionTotalsTrend = this.GetSessionTotalsTrend.bind(this);
|
|
35687
36241
|
this.GetSessionAnalysis = this.GetSessionAnalysis.bind(this);
|
|
35688
36242
|
this.ListSessionInsights = this.ListSessionInsights.bind(this);
|
|
35689
36243
|
this.GetSessionScoreTrend = this.GetSessionScoreTrend.bind(this);
|
|
@@ -35891,6 +36445,15 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
|
|
|
35891
36445
|
return promise.then((data) => SessionUsageTrendResponse.decode(new BinaryReader(data)));
|
|
35892
36446
|
}
|
|
35893
36447
|
|
|
36448
|
+
GetSessionTotalsTrend(
|
|
36449
|
+
request: GetSessionTotalsTrendRequest,
|
|
36450
|
+
metadata?: Metadata,
|
|
36451
|
+
): Promise<GetSessionTotalsTrendResponse> {
|
|
36452
|
+
const data = GetSessionTotalsTrendRequest.encode(request).finish();
|
|
36453
|
+
const promise = this.rpc.request(this.service, "GetSessionTotalsTrend", data, metadata);
|
|
36454
|
+
return promise.then((data) => GetSessionTotalsTrendResponse.decode(new BinaryReader(data)));
|
|
36455
|
+
}
|
|
36456
|
+
|
|
35894
36457
|
GetSessionAnalysis(request: GetSessionAnalysisRequest, metadata?: Metadata): Promise<GetSessionAnalysisResponse> {
|
|
35895
36458
|
const data = GetSessionAnalysisRequest.encode(request).finish();
|
|
35896
36459
|
const promise = this.rpc.request(this.service, "GetSessionAnalysis", data, metadata);
|
|
@@ -318,6 +318,28 @@ function deserialize_gateway_web_v1_GetSessionSummaryRequest(buffer_arg) {
|
|
|
318
318
|
return proto_gateway_web_v1_ai_gateway_pb.GetSessionSummaryRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
+
function serialize_gateway_web_v1_GetSessionTotalsTrendRequest(arg) {
|
|
322
|
+
if (!(arg instanceof proto_gateway_web_v1_ai_gateway_pb.GetSessionTotalsTrendRequest)) {
|
|
323
|
+
throw new Error('Expected argument of type gateway.web.v1.GetSessionTotalsTrendRequest');
|
|
324
|
+
}
|
|
325
|
+
return Buffer.from(arg.serializeBinary());
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function deserialize_gateway_web_v1_GetSessionTotalsTrendRequest(buffer_arg) {
|
|
329
|
+
return proto_gateway_web_v1_ai_gateway_pb.GetSessionTotalsTrendRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function serialize_gateway_web_v1_GetSessionTotalsTrendResponse(arg) {
|
|
333
|
+
if (!(arg instanceof proto_gateway_web_v1_ai_gateway_pb.GetSessionTotalsTrendResponse)) {
|
|
334
|
+
throw new Error('Expected argument of type gateway.web.v1.GetSessionTotalsTrendResponse');
|
|
335
|
+
}
|
|
336
|
+
return Buffer.from(arg.serializeBinary());
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function deserialize_gateway_web_v1_GetSessionTotalsTrendResponse(buffer_arg) {
|
|
340
|
+
return proto_gateway_web_v1_ai_gateway_pb.GetSessionTotalsTrendResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
|
341
|
+
}
|
|
342
|
+
|
|
321
343
|
function serialize_gateway_web_v1_GitActivityFrame(arg) {
|
|
322
344
|
if (!(arg instanceof proto_gateway_web_v1_ai_gateway_pb.GitActivityFrame)) {
|
|
323
345
|
throw new Error('Expected argument of type gateway.web.v1.GitActivityFrame');
|
|
@@ -1339,6 +1361,20 @@ getSessionUsageTrend: {
|
|
|
1339
1361
|
responseSerialize: serialize_gateway_web_v1_SessionUsageTrendResponse,
|
|
1340
1362
|
responseDeserialize: deserialize_gateway_web_v1_SessionUsageTrendResponse,
|
|
1341
1363
|
},
|
|
1364
|
+
// The sessions ListSessions lists with filter.active_after, per hour or calendar day of each session's last activity
|
|
1365
|
+
// and source system: how many sessions, and their whole-session model calls, tokens and cost. Each session's
|
|
1366
|
+
// lifetime totals land in the bucket of its last activity. Unpaged, bounded by its window. Mirrors ai.api.v1.
|
|
1367
|
+
getSessionTotalsTrend: {
|
|
1368
|
+
path: '/gateway.web.v1.AIGatewayService/GetSessionTotalsTrend',
|
|
1369
|
+
requestStream: false,
|
|
1370
|
+
responseStream: false,
|
|
1371
|
+
requestType: proto_gateway_web_v1_ai_gateway_pb.GetSessionTotalsTrendRequest,
|
|
1372
|
+
responseType: proto_gateway_web_v1_ai_gateway_pb.GetSessionTotalsTrendResponse,
|
|
1373
|
+
requestSerialize: serialize_gateway_web_v1_GetSessionTotalsTrendRequest,
|
|
1374
|
+
requestDeserialize: deserialize_gateway_web_v1_GetSessionTotalsTrendRequest,
|
|
1375
|
+
responseSerialize: serialize_gateway_web_v1_GetSessionTotalsTrendResponse,
|
|
1376
|
+
responseDeserialize: deserialize_gateway_web_v1_GetSessionTotalsTrendResponse,
|
|
1377
|
+
},
|
|
1342
1378
|
// One session's latest score against the scorer's rubric, with each criterion's assessment and improvement, and
|
|
1343
1379
|
// its latest insights with their cause and action; each part absent until its job has run. Mirrors ai.api.v1.
|
|
1344
1380
|
getSessionAnalysis: {
|