Skip to content

Commit bd34857

Browse files
authored
Merge branch 'master' into feature/my-contribution
2 parents cc6fb9f + ee0bdae commit bd34857

File tree

35 files changed

+51
-49
lines changed

35 files changed

+51
-49
lines changed

SECURITY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ All out of scope targets defined by huntr as well as:
5555
* **langchain-experimental**: This repository is for experimental code and is not
5656
eligible for bug bounties (see [package warning](https://pypi.org/project/langchain-experimental/)), bug reports to it will be marked as interesting or waste of
5757
time and published with no bounty attached.
58-
* **tools**: Tools in either langchain or langchain-community are not eligible for bug
58+
* **tools**: Tools in either `langchain` or `langchain-community` are not eligible for bug
5959
bounties. This includes the following directories
60-
* libs/langchain/langchain/tools
61-
* libs/community/langchain_community/tools
60+
* `libs/langchain/langchain/tools`
61+
* `libs/community/langchain_community/tools`
6262
* Please review the [Best Practices](#best-practices)
6363
for more details, but generally tools interact with the real world. Developers are
6464
expected to understand the security implications of their code and are responsible

libs/core/langchain_core/runnables/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ def assign(
774774
"""Assigns new fields to the `dict` output of this `Runnable`.
775775
776776
```python
777-
from langchain_community.llms.fake import FakeStreamingListLLM
777+
from langchain_core.language_models.fake import FakeStreamingListLLM
778778
from langchain_core.output_parsers import StrOutputParser
779779
from langchain_core.prompts import SystemMessagePromptTemplate
780780
from langchain_core.runnables import Runnable
@@ -5766,7 +5766,7 @@ class RunnableBinding(RunnableBindingBase[Input, Output]): # type: ignore[no-re
57665766
```python
57675767
# Create a Runnable binding that invokes the chat model with the
57685768
# additional kwarg `stop=['-']` when running it.
5769-
from langchain_community.chat_models import ChatOpenAI
5769+
from langchain_openai import ChatOpenAI
57705770
57715771
model = ChatOpenAI()
57725772
model.invoke('Say "Parrot-MAGIC"', stop=["-"]) # Should return `Parrot`

libs/core/langchain_core/runnables/history.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def get_by_session_id(session_id: str) -> BaseChatMessageHistory:
122122
```python
123123
from typing import Optional
124124
125-
from langchain_community.chat_models import ChatAnthropic
125+
from langchain_anthropic import ChatAnthropic
126126
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
127127
from langchain_core.runnables.history import RunnableWithMessageHistory
128128

libs/langchain/langchain_classic/_api/module_import.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def create_importer(
2626
imports to new imports.
2727
2828
The function will raise deprecation warning on loops using
29-
deprecated_lookups or fallback_module.
29+
`deprecated_lookups` or `fallback_module`.
3030
3131
Module lookups will import without deprecation warnings (used to speed
3232
up imports from large namespaces like llms or chat models).
@@ -37,26 +37,28 @@ def create_importer(
3737
loss of type information, IDE support for going to definition etc).
3838
3939
Args:
40-
package: current package. Use __package__
41-
module_lookup: maps name of object to the module where it is defined.
40+
package: Current package. Use `__package__`
41+
module_lookup: Maps name of object to the module where it is defined.
4242
e.g.,
43+
```json
4344
{
4445
"MyDocumentLoader": (
4546
"langchain_community.document_loaders.my_document_loader"
4647
)
4748
}
48-
deprecated_lookups: same as module look up, but will raise
49+
```
50+
deprecated_lookups: Same as module look up, but will raise
4951
deprecation warnings.
50-
fallback_module: module to import from if the object is not found in
51-
module_lookup or if module_lookup is not provided.
52+
fallback_module: Module to import from if the object is not found in
53+
`module_lookup` or if `module_lookup` is not provided.
5254
5355
Returns:
5456
A function that imports objects from the specified modules.
5557
"""
5658
all_module_lookup = {**(deprecated_lookups or {}), **(module_lookup or {})}
5759

5860
def import_by_name(name: str) -> Any:
59-
"""Import stores from langchain_community."""
61+
"""Import stores from `langchain_community`."""
6062
# If not in interactive env, raise warning.
6163
if all_module_lookup and name in all_module_lookup:
6264
new_module = all_module_lookup[name]

libs/langchain/langchain_classic/agents/json_chat/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def create_json_chat_agent(
5050
Example:
5151
```python
5252
from langchain_classic import hub
53-
from langchain_community.chat_models import ChatOpenAI
53+
from langchain_openai import ChatOpenAI
5454
from langchain_classic.agents import AgentExecutor, create_json_chat_agent
5555
5656
prompt = hub.pull("hwchase17/react-chat-json")

libs/langchain/langchain_classic/agents/openai_functions_agent/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def create_openai_functions_agent(
310310
Creating an agent with no memory
311311
312312
```python
313-
from langchain_community.chat_models import ChatOpenAI
313+
from langchain_openai import ChatOpenAI
314314
from langchain_classic.agents import (
315315
AgentExecutor,
316316
create_openai_functions_agent,

libs/langchain/langchain_classic/agents/openai_tools/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def create_openai_tools_agent(
4040
Example:
4141
```python
4242
from langchain_classic import hub
43-
from langchain_community.chat_models import ChatOpenAI
43+
from langchain_openai import ChatOpenAI
4444
from langchain_classic.agents import (
4545
AgentExecutor,
4646
create_openai_tools_agent,

libs/langchain/langchain_classic/agents/react/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def create_react_agent(
5959
Examples:
6060
```python
6161
from langchain_classic import hub
62-
from langchain_community.llms import OpenAI
62+
from langchain_openai import OpenAI
6363
from langchain_classic.agents import AgentExecutor, create_react_agent
6464
6565
prompt = hub.pull("hwchase17/react")

libs/langchain/langchain_classic/agents/self_ask_with_search/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def create_self_ask_with_search_agent(
116116
Examples:
117117
```python
118118
from langchain_classic import hub
119-
from langchain_community.chat_models import ChatAnthropic
119+
from langchain_anthropic import ChatAnthropic
120120
from langchain_classic.agents import (
121121
AgentExecutor,
122122
create_self_ask_with_search_agent,

libs/langchain/langchain_classic/agents/structured_chat/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def create_structured_chat_agent(
195195
Examples:
196196
```python
197197
from langchain_classic import hub
198-
from langchain_community.chat_models import ChatOpenAI
198+
from langchain_openai import ChatOpenAI
199199
from langchain_classic.agents import (
200200
AgentExecutor,
201201
create_structured_chat_agent,

0 commit comments

Comments
 (0)