Skip to content

generator-ai Error: Load model (Protobuf parsing failed) #187

@mrfelton

Description

@mrfelton

I tried this:

Hi, I'm unable to use the generator-api plugin (with google)

With google config only

When supplying a google api key, the generator fails, complaining that we don't have an openapi key, even though I'm not wanting to use it with openapi.

npm run generate

.env:

GOOGLE_GENERATIVE_AI_API_KEY=[MY GOOGLE KEY]

Error loading plugin: OpenAIError: The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).
at new OpenAI (/Users/tom/workspace/zap-middleware/eventcatalog/node_modules/openai/index.js:72:19)
at Object. (/Users/tom/workspace/zap-middleware/eventcatalog/node_modules/@eventcatalog/core/node_modules/@eventcatalog/generator-ai/dist/index.js:1207:14)

With some dummy value for openapi:

If I add some dummy value for the open api key, I get a different error:

npm run generate

.env:

OPENAI_API_KEY=dummy
GOOGLE_GENERATIVE_AI_API_KEY=[MY GOOGLE KEY]

@eventcatalog/generator-ai processing your catalog...

  • Splitting markdown documents...
    Error loading plugin: Error: Load model from /Users/tom/workspace/zap-middleware/eventcatalog/node_modules/@huggingface/transformers/.cache/Xenova/all-MiniLM-L6-v2/onnx/model.onnx failed:Protobuf parsing failed.
    at new OnnxruntimeSessionHandler (/Users/tom/workspace/zap-middleware/eventcatalog/node_modules/onnxruntime-node/dist/backend.js:24:92)
    at Immediate. (/Users/tom/workspace/zap-middleware/eventcatalog/node_modules/onnxruntime-node/dist/backend.js:64:29)
    at process.processImmediate (node:internal/timers:483:21)

This happened:

I'm unable to se the chat plugin (generator-ai) with a Google API key. It requires an OpenAPI key. Using a dummy value for the open api key then results in an error.

I expected this:

I expect to be able to use the chat plugin (generator-ai) with a Google API key.

Is there a workaround?

No response

Anything else?

My config:

{
    generators: [
        [
            "@eventcatalog/generator-ai", {
                splitMarkdownFiles: true,
                includeUsersAndTeams: false,
                includeSchemas: true,
                includeCustomDocumentation: false
            },
        ],
    ],
    chat: {
        enabled: true,
        provider: 'google',
        model: 'gemini-2.5-flash-preview-04-17',
    },
    output: 'server'
}

EventCatalog Version

2.42.1

Node.js Version

v20.18.1

Platform(s)

MacOS

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions