code-narrator icon indicating copy to clipboard operation
code-narrator copied to clipboard

TypeError: projectConfig.aiService is not a constructor

Open Bernardus opened this issue 3 years ago • 4 comments

When running npx code-narrator after generating a config file. I get two issues.

User-Agent: "OpenAI/NodeJS/3.2.1", SyntaxError: Unexpected token '-' ^ This one is easy to solve by adding single quotes 'User-Agent'

TypeError: projectConfig.aiService is not a constructor

The config has a aiService object, instead of a class(?).

const config = {
      //  begin of config
  aiService: {
    models: {
    },
    retryStatuses: [
      429,
      500,
      503,
    ],
    openai: {
      basePath: "https://api.openai.com/v1",
      axios: undefined,
      configuration: {
        apiKey: "***",
        organization: undefined,
        username: undefined,
        password: undefined,
        accessToken: undefined,
        basePath: undefined,
        baseOptions: {
          headers: {
            'User-Agent': "OpenAI/NodeJS/3.2.1",
            Authorization: "Bearer ***",
          },
        },
        formDataCtor: undefined,
      },
    },
  },
// rest of config  
}

Bernardus avatar May 25 '23 08:05 Bernardus

some problem here

hurradieweltgehtunter avatar Jun 19 '23 09:06 hurradieweltgehtunter

+1

moeric avatar Jun 23 '23 18:06 moeric

@ingig any idea?

hurradieweltgehtunter avatar Jun 26 '23 08:06 hurradieweltgehtunter

@Bernardus @moeric @hurradieweltgehtunter

Sorry for the late reply guys, my mistake of not having notifications enabled on the project

New version has been deployed, 1.0.17 which should fix the problem.

Before running 'npx code-narrator', delete code-narrator.js and let it generate it again

ingig avatar Jun 27 '23 12:06 ingig