Upgrade LLM deps, add Anthropic/Google providers, fix tiktoken crash … - #516
Open
cybr-wisp wants to merge 1 commit into
Open
Upgrade LLM deps, add Anthropic/Google providers, fix tiktoken crash …#516cybr-wisp wants to merge 1 commit into
cybr-wisp wants to merge 1 commit into
Conversation
Collaborator
|
Thank you for creating the PR. I think some of the test failures are due to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Closes #511
The LLM dependencies were outdated -> langchain-openai was pinned to <0.3, langchain-anthropic and langchain-google-genai were missing entirely, and tiktoken crashed on non-OpenAI model names at utils.py:221.
What changed:
Bumped langchain-core (0.3.x → 1.4+), langchain-openai (0.2.x → 1.0+), langchain-community (0.3.x → 0.4+), tiktoken (0.6+ → 0.8+), langchain-chroma (0.2.x → 1.0+)
Added langchain-anthropic and langchain-google-genai as optional extras, installable via pip install sherpa-ai[anthropic] or pip install sherpa-ai[google]
Fixed tiktoken.encoding_for_model() crash by adding a try/except KeyError with cl100k_base fallback for non-OpenAI models
Created SherpaChatAnthropic and SherpaChatGoogle model wrappers following the existing SherpaChatOpenAI pattern
Fixed deprecated ChatOpenAI import in test_utils/llms.py (moved from langchain_community to langchain_openai)
Relaxed spacy version constraint for Python 3.13 compatibility
Regenerated poetry.lock
After pulling these changes, run:
poetry lock && poetry install --with test -E anthropic -E google
Note on test results: 242/306 tests pass. The 61 failures fall into three categories, none caused by this PR: Windows file-locking errors (PermissionError on .db teardown), missing optional tokenizers package, and pre-existing get_relevant_documents deprecation in upstream langchain.
Type of change:
New feature (non-breaking change that adds functionality)
Related issues:
Closes #511, related to #510