Theia API Documentation v1.65.0
    Preparing search index...

    Hierarchy

    • OpenAI
      • MistralFixedOpenAI
    Index

    Constructors

    • API Client for interfacing with the OpenAI API.

      Parameters

      • Optional__namedParameters: ClientOptions

      Returns MistralFixedOpenAI

    Properties

    _options: ClientOptions
    apiKey: string
    audio: Audio
    baseURL: string
    batches: Batches
    beta: Beta
    chat: Chat
    completions: Completions
    containers: Containers
    conversations: Conversations
    embeddings: Embeddings
    evals: Evals
    fetchOptions: undefined | MergedRequestInit
    files: Files
    fineTuning: FineTuning
    graders: Graders
    idempotencyHeader?: string
    images: Images
    logger: undefined | Logger
    logLevel: undefined | LogLevel
    maxRetries: number
    models: Models
    moderations: Moderations
    organization: null | string
    project: null | string
    realtime: Realtime
    responses: Responses
    timeout: number
    uploads: Uploads
    vectorStores: VectorStores
    webhooks: Webhooks
    webhookSecret: null | string
    APIConnectionError: typeof APIConnectionError
    APIConnectionTimeoutError: typeof APIConnectionTimeoutError
    APIError: typeof APIError
    APIUserAbortError: typeof APIUserAbortError
    AuthenticationError: typeof AuthenticationError
    BadRequestError: typeof BadRequestError
    ConflictError: typeof ConflictError
    DEFAULT_TIMEOUT: number
    InternalServerError: typeof InternalServerError
    InvalidWebhookSignatureError: typeof InvalidWebhookSignatureError
    NotFoundError: typeof NotFoundError
    OpenAI: typeof OpenAI
    OpenAIError: typeof OpenAIError
    PermissionDeniedError: typeof PermissionDeniedError
    RateLimitError: typeof RateLimitError
    toFile: (
        value: ToFileInput | PromiseLike<ToFileInput>,
        name?: null | string,
        options?: FilePropertyBag,
    ) => Promise<File>

    Type Declaration

      • (
            value: ToFileInput | PromiseLike<ToFileInput>,
            name?: null | string,
            options?: FilePropertyBag,
        ): Promise<File>
      • Helper for creating a File to pass to an SDK upload method from a variety of different data formats

        Parameters

        • value: ToFileInput | PromiseLike<ToFileInput>

          the raw content of the file. Can be an Uploadable, BlobLikePart, or AsyncIterable of BlobLikeParts

        • Optionalname: null | string

          the name of the file. If omitted, toFile will try to determine a file name from bits if possible

        • Optionaloptions: FilePropertyBag

          additional properties

          • type

            the MIME type of the content

          • lastModified

            the last modified timestamp

        Returns Promise<File>

        a File with the given properties

    UnprocessableEntityError: typeof UnprocessableEntityError

    Methods

    • Returns Promise<boolean>

    • Parameters

      • opts: FinalRequestOptions

      Returns Promise<undefined | NullableHeaders>

    • Parameters

      • inputOptions: FinalRequestOptions
      • Optional__namedParameters: { retryCount?: number }

      Returns Promise<{ req: FinalizedRequestInit; timeout: number; url: string }>

    • Parameters

      • path: string
      • query: undefined | null | Record<string, unknown>
      • OptionaldefaultBaseURL: string

      Returns string

    • Returns string

    • Returns undefined | Record<string, undefined | string>

    • Type Parameters

      • Rsp

      Parameters

      • path: string
      • Optionalopts: PromiseOrValue<RequestOptions>

      Returns APIPromise<Rsp>

    • Parameters

      • url: _RequestInfo
      • init: undefined | RequestInit
      • ms: number
      • controller: AbortController

      Returns Promise<Response>

    • Type Parameters

      • Rsp

      Parameters

      • path: string
      • Optionalopts: PromiseOrValue<RequestOptions>

      Returns APIPromise<Rsp>

    • Type Parameters

      • Item
      • PageClass extends AbstractPage<Item> = AbstractPage<Item>

      Parameters

      • path: string
      • Page: new (...args: any[]) => PageClass
      • Optionalopts: RequestOptions

      Returns PagePromise<PageClass, Item>

    • Parameters

      • status: number
      • error: Object
      • message: undefined | string
      • headers: Headers

      Returns APIError

    • Type Parameters

      • Rsp

      Parameters

      • path: string
      • Optionalopts: PromiseOrValue<RequestOptions>

      Returns APIPromise<Rsp>

    post

    • post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>

      Type Parameters

      • Rsp

      Parameters

      • path: string
      • Optionalopts: PromiseOrValue<RequestOptions>

      Returns APIPromise<Rsp>

    • Used as a callback for mutating the given FinalRequestOptions object.

      Parameters

      • options: FinalRequestOptions

      Returns Promise<void>

    • Used as a callback for mutating the given RequestInit object.

      This is useful for cases where you want to add certain headers based off of the request properties, e.g. method or url.

      Parameters

      • request: RequestInit
      • __namedParameters: { options: FinalRequestOptions; url: string }

      Returns Promise<void>

    • Type Parameters

      • Rsp

      Parameters

      • path: string
      • Optionalopts: PromiseOrValue<RequestOptions>

      Returns APIPromise<Rsp>

    • Type Parameters

      • Rsp

      Parameters

      • options: PromiseOrValue<FinalRequestOptions>
      • OptionalremainingRetries: null | number

      Returns APIPromise<Rsp>

    • Type Parameters

      • Item = unknown
      • PageClass extends AbstractPage<Item> = AbstractPage<Item>

      Parameters

      • Page: new (
            ...args: [
                client: OpenAI,
                response: Response,
                body: unknown,
                options: FinalRequestOptions,
            ],
        ) => PageClass
      • options: FinalRequestOptions

      Returns PagePromise<PageClass, Item>

    • Parameters

      • query: Record<string, unknown>

      Returns string

    • Parameters

      • __namedParameters: NullableHeaders

      Returns void

    • Create a new client instance re-using the same options given to the current client with optional overriding.

      Parameters

      • options: Partial<ClientOptions>

      Returns this