Skip to content

The platform for continuously improving AI agents.

2.9 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 * as runtime from '../runtime';
import type {
  InferenceReceipt,
} from '../models/index';
import {
    InferenceReceiptFromJSON,
    InferenceReceiptToJSON,
} from '../models/index';

export interface InferenceRequestsRetrieveRequest {
    requestId: string;
}

/**
 *
 */
export class InferenceRequestsApi extends runtime.BaseAPI {

    /**
     */
    async inferenceRequestsRetrieveRaw(requestParameters: InferenceRequestsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InferenceReceipt>> {
        if (requestParameters['requestId'] == null) {
            throw new runtime.RequiredError(
                'requestId',
                'Required parameter "requestId" was null or undefined when calling inferenceRequestsRetrieve().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("ClerkBearerAuth", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        if (this.configuration && this.configuration.apiKey) {
            headerParameters["X-Api-Key"] = await this.configuration.apiKey("X-Api-Key"); // ApiKeyAuth authentication
        }

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerAuth", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/api/inference-requests/{request_id}/`;
        urlPath = urlPath.replace(`{${"request_id"}}`, encodeURIComponent(String(requestParameters['requestId'])));

        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => InferenceReceiptFromJSON(jsonValue));
    }

    /**
     */
    async inferenceRequestsRetrieve(requestParameters: InferenceRequestsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InferenceReceipt> {
        const response = await this.inferenceRequestsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

}