-
Notifications
You must be signed in to change notification settings - Fork 678
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
Fix LangChainOpenAIHandler for Azure #1102
Conversation
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Reviewer Guide 🔍
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Code Suggestions ✨
|
@functools.cache | ||
def _get_chat(self, deployment_id = None): |
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.
It was a quick way to ensure a single chat object existed per LLM deployment. I assumed chat initialization and first use could have some I/O overhead though thinking more about it I agree I'll remove it.
|
c610ed7
to
4201779
Compare
User description
Refactored to support delayed ChatOpenAI instantiation for Azure
Fixes #1101
PR Type
Enhancement, Bug fix
Description
LangChainOpenAIHandler
to improve Azure support and efficiency:_get_chat
method with@functools.cache
for lazy and efficient chat instance creationchat
method to use the new_get_chat
method, supporting delayedChatOpenAI
instantiation_chat
in the constructor and added early validationrequirements.txt
:Changes walkthrough 📝
langchain_ai_handler.py
Refactor LangChainOpenAIHandler for Azure support
pr_agent/algo/ai_handlers/langchain_ai_handler.py
LangChainOpenAIHandler
to support delayedChatOpenAI
instantiation for Azure
_get_chat
method with@functools.cache
for efficientchat instance creation
chat
method to use the new_get_chat
method_chat
in the constructor and added earlyvalidation
requirements.txt
Update LangChain dependencies
requirements.txt
0.1.20