IBM / ibm-generative-ai-node-sdk

Library that provides convenient access to the Generative AI API from Node.js applications
MIT License
35 stars 6 forks source link

error TS2304: Cannot find name 'ErrorOptions #76

Closed playground closed 8 months ago

playground commented 8 months ago

Trying this out. "@ibm-generative-ai/node-sdk": "^1.6.0"

but getting the following errors. For now to get by, I changed ErrorOptions to any.



18     constructor(message?: string, code?: string, cancelled?: boolean, options?: ErrorOptions);
                                                                                   ~~~~~~~~~~~~

node_modules/@ibm-generative-ai/node-sdk/dist/index.d.ts:21:60 - error TS2304: Cannot find name 'ErrorOptions'.

21     constructor(message?: string, code?: string, options?: ErrorOptions);
                                                              ~~~~~~~~~~~~

node_modules/@ibm-generative-ai/node-sdk/dist/index.d.ts:28:180 - error TS2304: Cannot find name 'ErrorOptions'.

28     constructor(message: string, statusText: string, statusCode: number, extensions: ErrorExtensions | undefined, response: ErrorResponse, headers: IncomingHttpHeaders, options?: ErrorOptions);
                                                                                                                                                                                      ~~~~~~~~~~~~

Found 3 errors in the same file, starting at: node_modules/@ibm-generative-ai/node-sdk/dist/index.d.ts:18```
Tomas2D commented 8 months ago

We are currently working on SDK v2, so we will not fix this. Ensure you are running Node 16+

playground commented 8 months ago

@Tomas2D, I'm running Node 18.17.1.

Also do I need to request an apikey? I'm getting unauthorized with my apikey. And is v2 available to try?

Tomas2D commented 8 months ago

V2 is not available yet for NodeJS SDK.

pilartomas commented 8 months ago

Make sure your api key corresponds to the environment you're targeting, e.g. https://workbench.res.ibm.com. If unsure, generate a new one.

playground commented 8 months ago

hmm, getting access denied with my IBMid https://workbench.res.ibm.com/.

image
Tomas2D commented 8 months ago

You'll need to request access to the Workbench environment. Talk to someone at IBM Research.