-
Notifications
You must be signed in to change notification settings - Fork 17k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Portkey LLMOps integration #7877
Conversation
…rs fix
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
langchain/embeddings/openai.py
Outdated
@@ -112,6 +113,7 @@ async def async_embed_with_retry(embeddings: OpenAIEmbeddings, **kwargs: Any) -> | |||
|
|||
@_async_retry_decorator(embeddings) | |||
async def _async_embed_with_retry(**kwargs: Any) -> Any: | |||
kwargs.update(embeddings._invocation_params) # Add invocation params |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invocation params should already be passed in as the kwargs, were you seeing issues here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. For example, passing headers here: response = OpenAIEmbeddings(headers={"x-portkey-api-key": "API_KEY"})
isn't working.
This is unique only to OpenAIEmbeddings on Python. For other models + on JS, it is working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, dropping that change for now - will verify from my end later
Revert openai embeddings changes
@baskaryan fixed formartting erros. It should pass all checks now. |
looks amazing, thanks @vrushankportkey! |
Integrating Portkey, which adds production features like caching, tracing, tagging, retries, etc. to langchain apps.
Also fixed a bug with OpenAIEmbeddings where headers weren't passing.
cc @baskaryan