Portkey-AI / portkey-node-sdk

Build reliable, secure, and production-ready AI apps easily.
https://portkey.ai/docs
22 stars 8 forks source link

Remove nodejs fetch namespace reference #22

Closed VisargD closed 9 months ago

VisargD commented 9 months ago

This SDK currently uses NodeJS.fetch namespace while exporting the Fetch type in baseClient.ts https://github.com/Portkey-AI/portkey-node-sdk/blob/a1adf914a5f7e2622153618a2a77120b84090b2a/src/baseClient.ts#L12

But in one of the recent PRs of @types/node, fetch namespace has been removed. https://github.com/DefinitelyTyped/DefinitelyTyped/pull/67341/files

Due to this, newer version of @types/node will throw a tsc build error as fetch namespace is not available in them.

Image

Solution: The current set of code only uses url as string in fetch calls. So its safe for now to replace RequestInfo with string.

dosubot[bot] commented 9 months ago

🤖

That sounds like a great solution! Your contribution will definitely help improve the compatibility of Portkey Node SDK with the latest versions of @types/node. Thank you for taking the initiative to propose this fix. Your effort is much appreciated!


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.