Open k1ng opened 10 months ago
Hey @k1ng , cool idea. Would you be open to contributing this functionality to the project? If so, I suggest the following approach:
config.yaml
file. Comment out the config option as a default.
https://github.com/getzep/zep/blob/90cd50d73995f2bcf8fa8493cd0a03aca3d15f7e/config.yaml#L41You may want to add two config options: One the header name and the other a secret, with the first being added in two above, but the secret kept to an environment variable only.
Create a new middleware function that pulls the header from appState.Config
and adds it to the HTTP Header. See this example: https://github.com/getzep/zep/blob/90cd50d73995f2bcf8fa8493cd0a03aca3d15f7e/pkg/server/middleware.go#L12
See here: https://github.com/getzep/zep/blob/90cd50d73995f2bcf8fa8493cd0a03aca3d15f7e/pkg/server/routes.go#L44
Happy to answer any questions. Also, happy to review a rough PR and work with you to finalize it.
Hi @danielchalef,
Thank you very much for your detailed explanation, it is appreciated. I'd like to contribute, but unfortunately, I lack the necessary experience with Go to make a pull request at this time. I will definitely keep your guidance in mind and hopefully, in the future, I will be able to make more substantial contributions to the project.
I'd like to work on this issue. Could you please assign it to me?
Feature Description
To integrate and proxy requests from Zep through Portkey.ai, we need the ability to add custom headers to our requests to the LLM. Please note that Portkey.ai already has an integration with Langchain.
Portkey.ai requires certain specific headers to be passed in every API call, which can be found in their documentation: https://docs.portkey.ai/how-portkey-works/portkey-headers
Value of Feature
This feature will allow logging Zep's requests to LLM and calculating the cost of LLM calls as a part of Zep-Portkey.ai integration. Custom headers support could also be useful for other potential integrations and use-cases.
Possible Implementation
We could provide the ability to set custom headers through environment variables, a
.env
file, or theconfig.yaml
file. This provides flexibility in choosing how to supply custom headers, depending on user preferences or security requirements.Thank You.