Skip to content

Commit

Permalink
Merge branch 'LindormIntegration' of github.com:AlwaysBluer/langchain…
Browse files Browse the repository at this point in the history
… into LindormIntegration

* 'LindormIntegration' of github.com:AlwaysBluer/langchain:
  docs: more standard test stubs (langchain-ai#28202)
  docs: links in integration contrib (langchain-ai#28200)
  standard-tests: rename langchain_standard_tests to langchain_tests, release 0.3.2 (langchain-ai#28203)
  infra: allow non-langchainai packages (langchain-ai#28199)
  openai: release 0.2.9, o1 streaming (langchain-ai#28197)
  docs: efficient rebuild (langchain-ai#28195)
  docs: fix embeddings tabs (langchain-ai#28193)
  docs: fixed a typo (langchain-ai#28191)
  docs[patch]: Add missing link to streaming concepts page (langchain-ai#28189)
  docs: add component tabs to integration landing pages (langchain-ai#28142)
  docs: community integration guide clarification (langchain-ai#28186)
  docs: standard test update (langchain-ai#28185)
  docs: fix grammatical error in delegation to sync methods (langchain-ai#28165)
  langchain: add missing punctuation in react_single_input.py (langchain-ai#28161)
  • Loading branch information
jiangzhijie committed Nov 19, 2024
2 parents 38bed84 + 8e292d2 commit 1563a8f
Show file tree
Hide file tree
Showing 86 changed files with 550 additions and 679 deletions.
36 changes: 20 additions & 16 deletions .github/scripts/prep_api_docs_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
def load_packages_yaml() -> Dict[str, Any]:
"""Load and parse the packages.yml file."""
with open("langchain/libs/packages.yml", "r") as f:
return yaml.safe_load(f)
all_packages = yaml.safe_load(f)

return {k: v for k, v in all_packages.items() if k["repo"]}


def get_target_dir(package_name: str) -> Path:
Expand All @@ -23,24 +25,19 @@ def get_target_dir(package_name: str) -> Path:
return base_path / "partners" / package_name_short


def clean_target_directories(packages: Dict[str, Any]) -> None:
def clean_target_directories(packages: list) -> None:
"""Remove old directories that will be replaced."""
for package in packages["packages"]:
if package["repo"] != "langchain-ai/langchain":
target_dir = get_target_dir(package["name"])
if target_dir.exists():
print(f"Removing {target_dir}")
shutil.rmtree(target_dir)
for package in packages:

target_dir = get_target_dir(package["name"])
if target_dir.exists():
print(f"Removing {target_dir}")
shutil.rmtree(target_dir)


def move_libraries(packages: Dict[str, Any]) -> None:
def move_libraries(packages: list) -> None:
"""Move libraries from their source locations to the target directories."""
for package in packages["packages"]:
# Skip if it's the main langchain repo or disabled
if package["repo"] == "langchain-ai/langchain" or package.get(
"disabled", False
):
continue
for package in packages:

repo_name = package["repo"].split("/")[1]
source_path = package["path"]
Expand Down Expand Up @@ -68,7 +65,14 @@ def main():
"""Main function to orchestrate the library sync process."""
try:
# Load packages configuration
packages = load_packages_yaml()
package_yaml = load_packages_yaml()
packages = [
p
for p in package_yaml["packages"]
if not p.get("disabled", False)
and p["repo"].startswith("langchain-ai/")
and p["repo"] != "langchain-ai/langchain"
]

# Clean target directories
clean_target_directories(packages)
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,7 @@ jobs:
# Replace all dashes in the package name with underscores,
# since that's how Python imports packages with dashes in the name.
if [ "$PKG_NAME" == "langchain-tests" ]; then
IMPORT_NAME="langchain_standard_tests"
else
IMPORT_NAME="$(echo "$PKG_NAME" | sed s/-/_/g)"
fi
IMPORT_NAME="$(echo "$PKG_NAME" | sed s/-/_/g)"
poetry run python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/api_doc_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
# Get unique repositories
REPOS=$(echo "$REPOS_UNSORTED" | sort -u)
# Checkout each unique repository
# Checkout each unique repository that is in langchain-ai org
for repo in $REPOS; do
if [ "$repo" != "langchain-ai/langchain" ]; then
if [[ "$repo" != "langchain-ai/langchain" && "$repo" == langchain-ai/* ]]; then
REPO_NAME=$(echo $repo | cut -d'/' -f2)
echo "Checking out $repo to $REPO_NAME"
git clone --depth 1 https://github.com/$repo.git $REPO_NAME
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ install-py-deps:

generate-files:
mkdir -p $(INTERMEDIATE_DIR)
cp -r $(SOURCE_DIR)/* $(INTERMEDIATE_DIR)
cp -rp $(SOURCE_DIR)/* $(INTERMEDIATE_DIR)

$(PYTHON) scripts/tool_feat_table.py $(INTERMEDIATE_DIR)

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/concepts/async.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Most popular LangChain integrations implement asynchronous support of their APIs
When an asynchronous implementation is not available, LangChain tries to provide a default implementation, even if it incurs
a **slight** overhead.

By default, LangChain will delegate the execution of a unimplemented asynchronous methods to the synchronous counterparts. LangChain almost always assumes that the synchronous method should be treated as a blocking operation and should be run in a separate thread.
By default, LangChain will delegate the execution of unimplemented asynchronous methods to the synchronous counterparts. LangChain almost always assumes that the synchronous method should be treated as a blocking operation and should be run in a separate thread.
This is done using [asyncio.loop.run_in_executor](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor) functionality provided by the `asyncio` library. LangChain uses the default executor provided by the `asyncio` library, which lazily initializes a thread pool executor with a default number of threads that is reused in the given event loop. While this strategy incurs a slight overhead due to context switching between threads, it guarantees that every asynchronous method has a default implementation that works out of the box.

## Performance
Expand Down
1 change: 1 addition & 0 deletions docs/docs/concepts/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The conceptual guide does not cover step-by-step instructions or specific implem
- **[Memory](https://langchain-ai.github.io/langgraph/concepts/memory/)**: Information about a conversation that is persisted so that it can be used in future conversations.
- **[Multimodality](/docs/concepts/multimodality)**: The ability to work with data that comes in different forms, such as text, audio, images, and video.
- **[Runnable interface](/docs/concepts/runnables)**: The base abstraction that many LangChain components and the LangChain Expression Language are built on.
- **[Streaming](/docs/concepts/streaming)**: LangChain streaming APIs for surfacing results as they are generated.
- **[LangChain Expression Language (LCEL)](/docs/concepts/lcel)**: A syntax for orchestrating LangChain components. Most useful for simpler applications.
- **[Document loaders](/docs/concepts/document_loaders)**: Load a source as a list of documents.
- **[Retrieval](/docs/concepts/retrieval)**: Information retrieval systems can retrieve structured or unstructured data from a datasource in response to a query.
Expand Down
6 changes: 5 additions & 1 deletion docs/docs/contributing/how_to/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

- [**Documentation**](documentation/index.mdx): Help improve our docs, including this one!
- [**Code**](code/index.mdx): Help us write code, fix bugs, or improve our infrastructure.
- [**Integrations**](integrations/index.mdx): Help us integrate with your favorite vendors and tools.

## Integrations

- [**Start Here**](integrations/index.mdx): Help us integrate with your favorite vendors and tools.
- [**Standard Tests**](integrations/standard_tests): Ensure your integration passes an expected set of tests.
9 changes: 5 additions & 4 deletions docs/docs/contributing/how_to/integrations/community.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
## How to add a community integration (deprecated)
## How to add a community integration (not recommended)

:::danger

We are no longer accepting new community integrations. Please see the
[main integration guide](./index.mdx) for more information on contributing new
integrations.
We recommend following the [main integration guide](./index.mdx) to add new integrations instead.

If you follow this guide, there is a high likelihood we will close your PR with the above
guide linked without much discussion.

:::

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/contributing/how_to/integrations/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ that will render on this site (https://python.langchain.com/).

As a prerequisite to adding your integration to our documentation, you must:

1. Confirm that your integration is in the list of components we are currently accepting.
1. Confirm that your integration is in the [list of components](#components-to-integrate) we are currently accepting.
2. Ensure that your integration is in a separate package that can be installed with `pip install <your-package>`.
3. Implement the standard tests for your integration and successfully run them.
3. Write documentation for your integration in the `docs/docs/integrations` directory of the LangChain monorepo.
3. [Implement the standard tests](/docs/contributing/how_to/integrations/standard_tests) for your integration and successfully run them.
3. Write documentation for your integration in the `docs/docs/integrations/<component_type>` directory of the LangChain monorepo.
4. Add a provider page for your integration in the `docs/docs/integrations/providers` directory of the LangChain monorepo.

Once you have completed these steps, you can submit a PR to the LangChain monorepo to add your integration to the documentation.
Expand Down
Loading

0 comments on commit 1563a8f

Please sign in to comment.