Skip to content

The platform for continuously improving AI agents.

4.8 KB
Raw Blame
/* tslint:disable */
/* eslint-disable */
/**
 * Overbae API
 * Backend API for the Overclaw / Overmind platform.
 *
 * The version of the OpenAPI document: 2.0.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { mapValues } from '../runtime';
/**
 * ``GET /api/sessions/`` row. Counts come from ``SessionViewSet`` annotations;
 * token/cost totals from the per-page ``session_usage`` context map.
 * @export
 * @interface Session
 */
export interface Session {
    /**
     *
     * @type {string}
     * @memberof Session
     */
    readonly id: string;
    /**
     *
     * @type {string}
     * @memberof Session
     */
    readonly externalId: string;
    /**
     *
     * @type {string}
     * @memberof Session
     */
    readonly name: string;
    /**
     *
     * @type {string}
     * @memberof Session
     */
    readonly project: string;
    /**
     *
     * @type {string}
     * @memberof Session
     */
    readonly capability: string | null;
    /**
     *
     * @type {string}
     * @memberof Session
     */
    readonly capabilityName: string | null;
    /**
     *
     * @type {number}
     * @memberof Session
     */
    readonly traceCount: number;
    /**
     *
     * @type {number}
     * @memberof Session
     */
    readonly spanCount: number;
    /**
     *
     * @type {number}
     * @memberof Session
     */
    readonly firstSpanNs: number | null;
    /**
     *
     * @type {number}
     * @memberof Session
     */
    readonly lastSpanNs: number | null;
    /**
     *
     * @type {number}
     * @memberof Session
     */
    readonly sessionScore: number | null;
    /**
     *
     * @type {number}
     * @memberof Session
     */
    readonly totalTokens: number | null;
    /**
     *
     * @type {number}
     * @memberof Session
     */
    readonly totalCost: number | null;
    /**
     *
     * @type {string}
     * @memberof Session
     */
    readonly model: string | null;
    /**
     *
     * @type {Date}
     * @memberof Session
     */
    readonly createdAt: Date;
}

/**
 * Check if a given object implements the Session interface.
 */
export function instanceOfSession(value: object): value is Session {
    if (!('id' in value) || value['id'] === undefined) return false;
    if (!('externalId' in value) || value['externalId'] === undefined) return false;
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('project' in value) || value['project'] === undefined) return false;
    if (!('capability' in value) || value['capability'] === undefined) return false;
    if (!('capabilityName' in value) || value['capabilityName'] === undefined) return false;
    if (!('traceCount' in value) || value['traceCount'] === undefined) return false;
    if (!('spanCount' in value) || value['spanCount'] === undefined) return false;
    if (!('firstSpanNs' in value) || value['firstSpanNs'] === undefined) return false;
    if (!('lastSpanNs' in value) || value['lastSpanNs'] === undefined) return false;
    if (!('sessionScore' in value) || value['sessionScore'] === undefined) return false;
    if (!('totalTokens' in value) || value['totalTokens'] === undefined) return false;
    if (!('totalCost' in value) || value['totalCost'] === undefined) return false;
    if (!('model' in value) || value['model'] === undefined) return false;
    if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
    return true;
}

export function SessionFromJSON(json: any): Session {
    return SessionFromJSONTyped(json, false);
}

export function SessionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Session {
    if (json == null) {
        return json;
    }
    return {

        'id': json['id'],
        'externalId': json['external_id'],
        'name': json['name'],
        'project': json['project'],
        'capability': json['capability'],
        'capabilityName': json['capability_name'],
        'traceCount': json['trace_count'],
        'spanCount': json['span_count'],
        'firstSpanNs': json['first_span_ns'],
        'lastSpanNs': json['last_span_ns'],
        'sessionScore': json['session_score'],
        'totalTokens': json['total_tokens'],
        'totalCost': json['total_cost'],
        'model': json['model'],
        'createdAt': (new Date(json['created_at'])),
    };
}

export function SessionToJSON(json: any): Session {
    return SessionToJSONTyped(json, false);
}

export function SessionToJSONTyped(value?: Omit<Session, 'id'|'external_id'|'name'|'project'|'capability'|'capability_name'|'trace_count'|'span_count'|'first_span_ns'|'last_span_ns'|'session_score'|'total_tokens'|'total_cost'|'model'|'created_at'> | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {

    };
}