Skip to content
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

check packages on init #917

Merged
merged 2 commits into from
Feb 21, 2024
Merged

check packages on init #917

merged 2 commits into from
Feb 21, 2024

Conversation

piotrm0
Copy link
Contributor

@piotrm0 piotrm0 commented Feb 21, 2024

Added checking for installed packages to main __init__ so we can catch problems before hard-to-debug errors arise.

If a user does not have a required package installed, an error is raised:

ModuleNotFoundError: 
Required package langchain is not installed. Please install it with pip:

    ```bash
    pip install 'langchain>=0.0.354'
    ```

If your distribution is in a bad place beyond this package, you may need to
reinstall trulens_eval so that all of the dependencies get installed:
    
    ```bash
    pip uninstall -y trulens_eval
    pip install trulens_eval
    ```

If a user has a required package installed but it is of a wrong version, this error is raised:

VersionConflict: Package langchain is installed but has a version conflict:
	(langchain 0.0.353 (/opt/homebrew/Caskroom/miniconda/base/envs/py311_trulens/lib/python3.11/site-packages), Requirement.parse('langchain>=0.0.354'))

This package is required for trulens_eval. Please resolve the conflict by
installing a compatible version with:

    ```bash
    pip install 'langchain>=0.0.354'
    ```

If you are running trulens_eval in a notebook, you may need to restart the
kernel after resolving the conflict. If your distribution is in a bad place
beyond this package, you may need to reinstall trulens_eval so that all of the
dependencies get installed and hopefully corrected:
    
    ```bash
    pip uninstall -y trulens_eval
    pip install trulens_eval
    ```

If a user has an optional package with a version conflict, a warning is printed:

Package llama-index is installed but has a version conflict:
	(llama-index 0.10.9 (/opt/homebrew/Caskroom/miniconda/base/envs/py311_trulens/lib/python3.11/site-packages), Requirement.parse('llama-index<0.10.0,>=0.9.26'))

This package is optional for trulens_eval so this may not be a problem but if
you need to use the related optional features and find there are errors, you
will need to resolve the conflict:

    ```bash
    pip install 'llama-index<0.10.0,>=0.9.26'
    ```

If you are running trulens_eval in a notebook, you may need to restart the
kernel after resolving the conflict. If your distribution is in a bad place
beyond this package, you may need to reinstall trulens_eval so that all of the
dependencies get installed and hopefully corrected:
    
    ```bash
    pip uninstall -y trulens_eval
    pip install trulens_eval
    ```

If a user does not have an optional package, only debug-level message is printed (not visible by default):

Optional package llama-index is not installed. Related optional functionality will not be
available.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 21, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 21, 2024
@joshreini1 joshreini1 merged commit df9adac into main Feb 21, 2024
8 checks passed
Josephrp pushed a commit to Josephrp/trulens that referenced this pull request Feb 23, 2024
* adding cost tracking tests and cost tracking with litellm

* move endpoint cost tests outside of unit tests folder

* adjust docs parameters

* finishing bedrock issues and moved around some tests

check packages on init (truera#917)

* add check imports

* nits

Increase provider test coverage to Huggingface feedback provider (truera#919)

upgrade Llama-Index integration to 0.10 (truera#891)

* upgrade tru_llama

* Update tru_llama.py

* fix indent

* optional imports

* migrate to 0.10

* trullama docstring

* change data load to dir reader in test

* more import changes

* update create_llama

* shrink async test

* test response text from object

* ignore output in json assert

* simplify langchain prompts

* cost tracking tests and litellm cost tracking (truera#910)

* adding cost tracking tests and cost tracking with litellm

* move endpoint cost tests outside of unit tests folder

* adjust docs parameters

* finishing bedrock issues and moved around some tests

* Update tru_llama.py

* framework-llama-notebook imports

* import lines llama

* pinecone quickstart llama update

* updage agents notebook

* llama version update

* missed import changes

* more import changes

---------

Co-authored-by: Piotr Mardziel <piotrm@gmail.com>

Automated File Generation from Docs Notebook Changes (truera#922)

Co-authored-by: joshreini1 <joshreini1@users.noreply.github.com>

Update issue templates (truera#923)

* Update issue templates

* Update bug-report.md

* Update feature_request.md

adding notebook explanations

async handling adjustments (truera#918)

* working

* adjuting async wrapping to produce a record before final result is ready

* docs and finish awaitable wrapping

* clear notebook

* nits and docs

* typo

* fix bug in prior pr

* update streamlit version lower bound

* format

* fixing up docs

* add integration tests to release pipeline

* fix job name

* adjust pipeline config

* fixing up tests

* fixes and don't run db integration tests

* update some llama index imports

* address migration error in release pipeline

* fix makefile

* add another llama index package

bearer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants