-
Notifications
You must be signed in to change notification settings - Fork 16k
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
IBM: added partners package langchain_ibm
, added llm
#16512
Merged
efriis
merged 31 commits into
langchain-ai:master
from
MateuszOssGit:langchain-ibm-package-llm
Feb 14, 2024
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
3371f08
add langchain_ibm package, add llm
MateuszOssGit 8dec2a7
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit 8b36576
remove integration tests
MateuszOssGit ca8fa9d
fix python version in pyproject
MateuszOssGit b53b64a
fix
MateuszOssGit 3e7f350
add init to integration tests
MateuszOssGit d142afa
add test dependencies
MateuszOssGit a7dd54c
add test_compile file
MateuszOssGit 7b4db4c
add integration test path in makefile and update docstring in integra…
MateuszOssGit 12530e5
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit 727f2be
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit 4371159
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit c4a3578
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit 8ba77de
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit 984433a
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit 84b4db9
fix comments
MateuszOssGit b521062
make format and make lint
MateuszOssGit 1516160
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit 599a581
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit 74b8408
add integration tests for generate stream and generate with multiple …
MateuszOssGit b0202ad
Merge branch 'langchain-ibm-package-llm' of https://github.com/Mateus…
MateuszOssGit 86d260b
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit a2853a8
Merge branch 'langchain-ai:master' into langchain-ibm-package-llm
MateuszOssGit e00918e
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit cdb8ece
Merge branch 'master' into langchain-ibm-package-llm
efriis bd8f8ba
cr
efriis b1d44aa
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit 0c97462
Merge branch 'master' into langchain-ibm-package-llm
MateuszOssGit d946c3e
update langchain-core req
MateuszOssGit 093b203
add project id
efriis b7d1788
Merge branch 'master' into langchain-ibm-package-llm
efriis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__pycache__ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 LangChain, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.PHONY: all format lint test tests integration_tests docker_tests help extended_tests | ||
|
||
# Default target executed when no arguments are given to make. | ||
all: help | ||
|
||
# Define a variable for the test file path. | ||
TEST_FILE ?= tests/unit_tests/ | ||
|
||
integration_test integration_tests: TEST_FILE=tests/integration_tests/ | ||
|
||
test tests integration_test integration_tests: | ||
poetry run pytest $(TEST_FILE) | ||
|
||
|
||
###################### | ||
# LINTING AND FORMATTING | ||
###################### | ||
|
||
# Define a variable for Python and notebook files. | ||
PYTHON_FILES=. | ||
MYPY_CACHE=.mypy_cache | ||
lint format: PYTHON_FILES=. | ||
lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/partners/ibm --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$') | ||
lint_package: PYTHON_FILES=langchain_ibm | ||
lint_tests: PYTHON_FILES=tests | ||
lint_tests: MYPY_CACHE=.mypy_cache_test | ||
|
||
lint lint_diff lint_package lint_tests: | ||
poetry run ruff . | ||
poetry run ruff format $(PYTHON_FILES) --diff | ||
poetry run ruff --select I $(PYTHON_FILES) | ||
mkdir $(MYPY_CACHE); poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE) | ||
|
||
format format_diff: | ||
poetry run ruff format $(PYTHON_FILES) | ||
poetry run ruff --select I --fix $(PYTHON_FILES) | ||
|
||
spell_check: | ||
poetry run codespell --toml pyproject.toml | ||
|
||
spell_fix: | ||
poetry run codespell --toml pyproject.toml -w | ||
|
||
check_imports: $(shell find langchain_ibm -name '*.py') | ||
poetry run python ./scripts/check_imports.py $^ | ||
|
||
###################### | ||
# HELP | ||
###################### | ||
|
||
help: | ||
@echo '----' | ||
@echo 'check_imports - check imports' | ||
@echo 'format - run code formatters' | ||
@echo 'lint - run linters' | ||
@echo 'test - run unit tests' | ||
@echo 'tests - run unit tests' | ||
@echo 'test TEST_FILE=<test_file> - run all tests in file' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# langchain-ibm | ||
|
||
This package contains the LangChain integrations for IBM watsonx.ai through their `ibm-watsonx-ai` SDK. | ||
|
||
## Installation and Setup | ||
|
||
- Install the LangChain partner package | ||
```bash | ||
pip install langchain-ibm | ||
``` | ||
|
||
## LLM | ||
|
||
See a [usage example](https://python.langchain.com/docs/integrations/llms/watsonxllm). | ||
|
||
```python | ||
from langchain_ibm import WatsonxLLM | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from langchain_ibm.llms import WatsonxLLM | ||
|
||
__all__ = ["WatsonxLLM"] |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Was this creating failures? Why is this removed?
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.
@efriis I was getting error
TypeError: Additional kwargs key generated_token_count already exists in left dict and value has unsupported type <class 'int'>.
when i used stream method:or
The error is related with
merge_dicts
method inlangchain_core.utils._merge