@grafctory/llms
    Preparing search index...

    Module @grafctory/llms-google - v0.9.0

    Google model connectors.

    Connects AI jobs to Google 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 Google GenAI SDK, whose whole surface it re-exports: import SDK values and types from here rather than from @google/genai, so they always match the client and no direct dependency on the SDK is needed.

    @grafctory/llms-google

    npm Grafctory

    Google model connectors for @grafctory/llms.

    Connects AI jobs to Google 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-google # this package
    Important

    Node.js 22 or later is required.

    Important

    This package stands in for the Google GenAI SDK: import SDK values and types from here, never from @google/genai. 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.

    createGoogleAI

    Creates a Gemini API client that works around known API limitations.

    text

    Extracts the output text of a Gemini API response.

    json

    Extracts the output text of a Gemini API response as a JSON payload.

    embedding

    Extracts the embedding of a Gemini API response.