Skip to content

Upgrade langchain #450

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

Merged
merged 16 commits into from
Mar 19, 2024
Merged

Upgrade langchain #450

merged 16 commits into from
Mar 19, 2024

Conversation

ross-p-smith
Copy link
Collaborator

@ross-p-smith ross-p-smith commented Mar 18, 2024

Purpose

Both langchain and langchain-community needed upgrading. langchain-community needs to use langchain-openai and then this causes us to upgrade the version of openai.

The new versions of these packages no longer use the environment variable OPENAI_API_BASE, but rather insist on using AZURE_OPENAI_ENDPOINT

I have re-ordered the environment variables in the bicep files so that they are a bit easier to see and find.

Relates to #417

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[x] Other... Please describe:

@ross-p-smith ross-p-smith marked this pull request as draft March 18, 2024 09:43
Copy link

github-actions bot commented Mar 18, 2024

Coverage

Coverage Report •
FileStmtsMissCoverMissing
code
   app.py1244266%29, 110, 149–150, 154, 157–158, 172–174, 176, 184, 188–192, 194, 201, 205–207, 213, 219–220, 222–223, 226, 240–241, 258, 260–261, 265, 274–278, 295, 297, 345
code/backend/batch/utilities/helpers
   EnvHelper.py901781%85–87, 89–90, 93, 96, 99, 174, 179–180, 183–185, 189–191
   LLMHelper.py332039%11–13, 15–16, 22, 28–29, 34, 37–38, 47, 58–59, 71, 83–84, 91, 101, 109
code/backend/batch/utilities/orchestrator
   LangChainAgent.py684533%20–24, 56, 59–60, 65–66, 71, 74–76, 81, 88, 91–95, 97–99, 103–106, 110–115, 117–120, 126–127, 132–133, 136, 139, 144
TOTAL162598039% 

Tests Skipped Failures Errors Time
29 0 💤 0 ❌ 0 🔥 10.302s ⏱️

@ross-p-smith ross-p-smith marked this pull request as ready for review March 18, 2024 17:33
infra/main.bicep Outdated
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes here are just order



class Testing_LangChainAgent(LangChainAgent):
def __init__(self) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice way of overriding values when you can't provide them via the constructor! Do we need to call super().__init__() here though? I can see we're doing it in a few places, including the LangChainAgent,

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I call super.__init then I will also create a whole set of connected server objects which makes it hard to test. The idea was to not initialise the base class and just to test these two methods.

@ross-p-smith ross-p-smith requested a review from adamdougal March 19, 2024 15:47
Co-authored-by: Chinedum Echeta <60179183+cecheta@users.noreply.github.com>
@ross-p-smith ross-p-smith requested a review from cecheta March 19, 2024 16:23
@ross-p-smith ross-p-smith added this pull request to the merge queue Mar 19, 2024
Merged via the queue into main with commit 859f31f Mar 19, 2024
@ross-p-smith ross-p-smith deleted the ross/sc2 branch March 19, 2024 17:15
superhindupur pushed a commit that referenced this pull request Mar 20, 2024
* Upgrade langchain

* Had to upgradeOpenAi

* Add a few langchain agent tests

* Upgrade langchain_openai

* Ordered config alphabetically

* Missing lock file

* Removing AZURE_OPENAI_KEY

* Fix LLM Helper

* we dont have that env set anymore - so we dont need to delete

* remove comment

* Update .gitignore

Co-authored-by: Chinedum Echeta <60179183+cecheta@users.noreply.github.com>

---------

Co-authored-by: Chinedum Echeta <60179183+cecheta@users.noreply.github.com>
eduardogch pushed a commit to devopsdale/chat-with-your-data-solution-accelerator that referenced this pull request Apr 30, 2024
* Upgrade langchain

* Had to upgradeOpenAi

* Add a few langchain agent tests

* Upgrade langchain_openai

* Ordered config alphabetically

* Missing lock file

* Removing AZURE_OPENAI_KEY

* Fix LLM Helper

* we dont have that env set anymore - so we dont need to delete

* remove comment

* Update .gitignore

Co-authored-by: Chinedum Echeta <60179183+cecheta@users.noreply.github.com>

---------

Co-authored-by: Chinedum Echeta <60179183+cecheta@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants