Portkey-AI / portkey-node-sdk

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

Accept cacheForceRefresh as setting and pass it as header #32

Closed VisargD closed 8 months ago

VisargD commented 8 months ago

Problem: x-portkey-cache-force-refresh header allows user to refresh the cache record for the call. But SDK does not accept and pass any cacheForceRefresh setting. For TS projects, this gives an error as cacheForceRefresh is not a part of ApiClientInterface. And this setting is also not getting considered while calling createHeaders method with input settings.

https://github.com/Portkey-AI/portkey-node-sdk/blob/f4629f569b945cd0dfe8403a7b9cb0218c82a84b/src/_types/generalTypes.ts#L3-L12

https://github.com/Portkey-AI/portkey-node-sdk/blob/f4629f569b945cd0dfe8403a7b9cb0218c82a84b/src/baseClient.ts#L122-L128

dosubot[bot] commented 8 months ago

🤖

It's great to see that you've identified an issue and a potential solution for the SDK. Your contribution to adding the cacheForceRefresh setting and passing it as a header would be valuable. We encourage you to create a pull request with your proposed changes to the repository. Thank you for your willingness to improve the SDK!

#### About Dosu 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.