Skip to content

Commit

Permalink
docs: added community modules descriptions (langchain-ai#17827)
Browse files Browse the repository at this point in the history
API Reference: Several `community` modules (like
[adapter](https://api.python.langchain.com/en/latest/community_api_reference.html#module-langchain_community.adapters)
module) are missing descriptions. It happens when langchain was split to
the core, langchain and community packages.
- Copied module descriptions from other packages
- Fixed several descriptions to the consistent format.
  • Loading branch information
leo-gan authored and al1p-R committed Feb 27, 2024
1 parent ae49e8f commit c558820
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 25 deletions.
8 changes: 8 additions & 0 deletions libs/community/langchain_community/adapters/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""**Adapters** are used to adapt LangChain models to other APIs.
LangChain integrates with many model providers.
While LangChain has its own message and model APIs,
LangChain has also made it as easy as
possible to explore other models by exposing an **adapter** to adapt LangChain
models to the other APIs, as to the OpenAI API.
"""
16 changes: 2 additions & 14 deletions libs/community/langchain_community/agent_toolkits/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
"""Agent toolkits contain integrations with various resources and services.
LangChain has a large ecosystem of integrations with various external resources
like local and remote file systems, APIs and databases.
These integrations allow developers to create versatile applications that combine the
power of LLMs with the ability to access, interact with and manipulate external
resources.
When developing an application, developers should inspect the capabilities and
permissions of the tools that underlie the given agent toolkit, and determine
whether permissions of the given toolkit are appropriate for the application.
See [Security](https://python.langchain.com/docs/security) for more information.
"""**Toolkits** are sets of tools that can be used to interact with
various services and APIs.
"""
from langchain_community.agent_toolkits.ainetwork.toolkit import AINetworkToolkit
from langchain_community.agent_toolkits.amadeus.toolkit import AmadeusToolkit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
"""**Chat message history** stores a history of the message interactions in a chat.
**Class hierarchy:**
.. code-block::
BaseChatMessageHistory --> <name>ChatMessageHistory # Examples: FileChatMessageHistory, PostgresChatMessageHistory
**Main helpers:**
.. code-block::
AIMessage, HumanMessage, BaseMessage
""" # noqa: E501

from langchain_community.chat_message_histories.astradb import (
AstraDBChatMessageHistory,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
"""Logic for selecting examples to include in prompts."""
"""**Example selector** implements logic for selecting examples to include them
in prompts.
This allows us to select examples that are most relevant to the input.
There could be multiple strategies for selecting examples. For example, one could
select examples based on the similarity of the input to the examples. Another
strategy could be to select examples based on the diversity of the examples.
"""
from langchain_community.example_selectors.ngram_overlap import (
NGramOverlapExampleSelector,
ngram_overlap_score,
Expand Down
13 changes: 13 additions & 0 deletions libs/community/langchain_community/indexes/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""**Index** is used to avoid writing duplicated content
into the vectostore and to avoid over-writing content if it's unchanged.
Indexes also :
* Create knowledge graphs from data.
* Support indexing workflows from LangChain data loaders to vectorstores.
Importantly, Index keeps on working even if the content being written is derived
via a set of transformations from some source content (e.g., indexing children
documents that were derived from parent documents by chunking.)
"""
16 changes: 12 additions & 4 deletions libs/community/langchain_community/storage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
"""Implementations of key-value stores and storage helpers.
"""**Storage** is an implementation of key-value store.
Module provides implementations of various key-value stores that conform
Storage module provides implementations of various key-value stores that conform
to a simple key-value interface.
The primary goal of these storages is to support implementation of caching.
"""
The primary goal of these storages is to support caching.
**Class hierarchy:**
.. code-block::
BaseStore --> <name>Store # Examples: MongoDBStore, RedisStore
""" # noqa: E501

from langchain_community.storage.astradb import (
AstraDBByteStore,
Expand Down
10 changes: 4 additions & 6 deletions libs/langchain/langchain/indexes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
"""Code to support various indexing workflows.
"""**Index** is used to avoid writing duplicated content
into the vectostore and to avoid over-writing content if it's unchanged.
Provides code to:
Indexes also :
* Create knowledge graphs from data.
* Support indexing workflows from LangChain data loaders to vectorstores.
For indexing workflows, this code is used to avoid writing duplicated content
into the vectostore and to avoid over-writing content if it's unchanged.
Importantly, this keeps on working even if the content being written is derived
Importantly, Index keeps on working even if the content being written is derived
via a set of transformations from some source content (e.g., indexing children
documents that were derived from parent documents by chunking.)
"""
Expand Down

0 comments on commit c558820

Please sign in to comment.