Portkey-AI / portkey-node-sdk

Build reliable, secure, and production-ready AI apps easily.

Home Page:https://portkey.ai/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Getting errors on Vercel. To test the SDK on edge environments.

vrushankportkey opened this issue · comments

Contact Details

No response

What happened?

A bug happened!

Version

0.1.xx (Default)

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

🤖

Hey @vrushankportkey! Good to see you again. Let's dive into this bug you've encountered.

I'm sorry to hear that you're encountering issues with the Portkey Node SDK on Vercel. To better assist you, I need more specific details about the error you're experiencing. The error message you're receiving would be particularly helpful.

Based on the context provided, there are several common issues that can cause errors when deploying the Portkey Node SDK on Vercel:

  1. Missing API Key: Ensure you have set the PORTKEY_API_KEY environment variable or passed the api_key in the initialization of Portkey. API keys can be found or created at the Portkey Dashboard.

  2. Missing Base URL: You should provide a valid base URL, for example: https://api.portkey.ai

  3. Missing Config Parameter: You should provide a valid Config object.

  4. Missing Mode Parameter: You should provide a valid mode literal.

  5. Invalid Portkey Mode: The "mode" parameter should be of type "ModesLiteral | Modes | None".

You can refer to the src/constants.ts file for more details.

As for your current configuration, it's stored in the config property of the Portkey class. The value of this property is set in the constructor of the class, and it can be either a record of string keys to unknown values, a string, null, or undefined. You can check this in the src/client.ts file.

Regarding the version you're using (0.1.xx), I couldn't find specific information about it in the repository. It would be helpful if you could provide the exact version number.

Please provide more details about the error message you're receiving and the exact version of the SDK you're using so I can assist you further.

Sources


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.

Fixed with this PR: #20

Available from version 1.1.2 onwards.