// This file is auto-generated by @hey-api/openapi-ts

import type { Client, Options as Options2, TDataShape } from './client';
import { client } from './client.gen';
import type { GetPrivateModelsData, GetPrivateModelsErrors, GetPrivateModelsResponses, PostChatCompletionsData, PostChatCompletionsErrors, PostChatCompletionsResponses } from './types.gen';

export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
    /**
     * You can provide a client instance returned by `createClient()` instead of
     * individual options. This might be also useful if you want to implement a
     * custom client.
     */
    client?: Client;
    /**
     * You can pass arbitrary values through the `meta` object. This can be
     * used to access values that aren't defined as part of the SDK function.
     */
    meta?: Record<string, unknown>;
};

export const postChatCompletions = <ThrowOnError extends boolean = false>(options: Options<PostChatCompletionsData, ThrowOnError>) => (options.client ?? client).post<PostChatCompletionsResponses, PostChatCompletionsErrors, ThrowOnError>({
    security: [{ scheme: 'bearer', type: 'http' }],
    url: '/chat/completions',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

export const getPrivateModels = <ThrowOnError extends boolean = false>(options?: Options<GetPrivateModelsData, ThrowOnError>) => (options?.client ?? client).get<GetPrivateModelsResponses, GetPrivateModelsErrors, ThrowOnError>({
    security: [{ scheme: 'bearer', type: 'http' }],
    url: '/models',
    ...options
});
