/**
 * This file was auto-generated by openapi-typescript.
 * Do not make direct changes to the file.
 */

export interface paths {
  "/v1/completions": {
    post: operations["completion"];
  };
  "/v1/events": {
    post: operations["event"];
  };
  "/v1/health": {
    post: operations["health"];
  };
}

export type webhooks = Record<string, never>;

export interface components {
  schemas: {
    Choice: {
      /** Format: int32 */
      index: number;
      text: string;
    };
    /**
     * @example {
     *   "language": "python",
     *   "segments": {
     *     "prefix": "def fib(n):\n    ",
     *     "suffix": "\n        return fib(n - 1) + fib(n - 2)"
     *   }
     * }
     */
    CompletionRequest: {
      /** @example def fib(n): */
      prompt?: string | null;
      /**
       * @description Language identifier, full list is maintained at
       * https://code.visualstudio.com/docs/languages/identifiers
       * @example python
       */
      language?: string | null;
      segments?: components["schemas"]["Segments"] | null;
      user?: string | null;
    };
    CompletionResponse: {
      id: string;
      choices: components["schemas"]["Choice"][];
    };
    HealthState: {
      model: string;
      device: string;
      compute_type: string;
      arch: string;
      cpu_info: string;
      cpu_count: number;
      cuda_devices: string[];
      version: components["schemas"]["Version"];
    };
    LogEventRequest: {
      /**
       * @description Event type, should be `view` or `select`.
       * @example view
       */
      type: string;
      completion_id: string;
      /** Format: int32 */
      choice_index: number;
    };
    Segments: {
      /** @description Content that appears before the cursor in the editor window. */
      prefix: string;
      /** @description Content that appears after the cursor in the editor window. */
      suffix?: string | null;
    };
    Version: {
      build_date: string;
      build_timestamp: string;
      git_sha: string;
      git_describe: string;
    };
  };
  responses: never;
  parameters: never;
  requestBodies: never;
  headers: never;
  pathItems: never;
}

export type $defs = Record<string, never>;

export type external = Record<string, never>;

export interface operations {
  completion: {
    requestBody: {
      content: {
        "application/json": components["schemas"]["CompletionRequest"];
      };
    };
    responses: {
      /** @description Success */
      200: {
        content: {
          "application/json": components["schemas"]["CompletionResponse"];
        };
      };
      /** @description Bad Request */
      400: {
        content: never;
      };
    };
  };
  event: {
    requestBody: {
      content: {
        "application/json": components["schemas"]["LogEventRequest"];
      };
    };
    responses: {
      /** @description Success */
      200: {
        content: never;
      };
      /** @description Bad Request */
      400: {
        content: never;
      };
    };
  };
  health: {
    responses: {
      /** @description Success */
      200: {
        content: {
          "application/json": components["schemas"]["HealthState"];
        };
      };
    };
  };
}
