@grafctory/llms
    Preparing search index...

    Module @grafctory/llms-openai - v0.9.0

    OpenAI model connectors.

    Connects AI jobs to OpenAI models, ready to work alongside any other task in a pipeline. Long runs proceed reliably to completion, and every result a job receives from a model can be trusted as complete. The cost of each request is logged under the labels of the job issuing it, so any spike can be traced back to its source.

    Stands in for the OpenAI Node API Library, re-exporting its whole surface, default export included: import SDK values and types from here rather than from openai, so they always match the client without a direct SDK dependency.

    @grafctory/llms-openai

    npm Grafctory

    OpenAI model connectors for @grafctory/llms.

    Connects AI jobs to OpenAI models, ready to work alongside any other task in a pipeline. Long runs proceed reliably to completion, and every result a job receives from a model can be trusted as complete. The cost of each request is logged under the labels of the job issuing it, so any spike can be traced back to its source.

    Installation

    npm install @grafctory/gear         # the job executor
    npm install @grafctory/llms # AI tasks and shared services
    npm install @grafctory/llms-openai # this package
    Important

    Node.js 22 or later is required.

    Important

    This package stands in for the OpenAI Node API Library: import SDK values and types from here, never from openai. It ships the SDK release its workarounds are tested against. A separately installed copy may be another release, and the client then no longer matches the SDK types the consumer imports from that copy.

    Warning

    TypeScript consumers must use "moduleResolution": "nodenext"/"node16"/"bundler" in tsconfig.json. The legacy "node" resolver is not supported.

    Usage

    See the API reference.

    Support

    • open an issue to report a problem or to suggest a new feature
    • start a discussion to ask a how-to question or to share an idea

    License

    This project is licensed under the Apache 2.0 License – see LICENSE file for details.

    Grafctory™ is a trademark of Metreeca srl.

    createOpenAI

    Creates an OpenAI API client paced against the published rate quotas.

    text

    Extracts the output text of a chat completion.

    json

    Extracts the output text of a chat completion as a JSON payload.

    embedding

    Extracts the embedding of an OpenAI API response.