mirror of
https://github.com/hwchase17/langchain.git
synced 2026-02-21 22:56:05 +00:00
x
This commit is contained in:
@@ -8,7 +8,6 @@ from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Type, Union, cast
|
||||
|
||||
import yaml
|
||||
from langchain.schema import RUN_KEY
|
||||
|
||||
from langchain_core._api import deprecated
|
||||
from langchain_core.callbacks import (
|
||||
@@ -40,6 +39,9 @@ def _get_verbosity() -> bool:
|
||||
return get_verbose()
|
||||
|
||||
|
||||
RUN_KEY = "__run"
|
||||
|
||||
|
||||
class Chain(RunnableSerializable[Dict[str, Any], Dict[str, Any]], ABC):
|
||||
"""Abstract base class for creating structured sequences of calls to components.
|
||||
|
||||
|
||||
@@ -9,11 +9,7 @@ from langchain_core.legacy.memory.combined import CombinedMemory
|
||||
from langchain_core.legacy.memory.entity import (
|
||||
ConversationEntityMemory,
|
||||
InMemoryEntityStore,
|
||||
RedisEntityStore,
|
||||
SQLiteEntityStore,
|
||||
UpstashRedisEntityStore,
|
||||
)
|
||||
from langchain_core.legacy.memory.kg import ConversationKGMemory
|
||||
from langchain_core.legacy.memory.readonly import ReadOnlySharedMemory
|
||||
from langchain_core.legacy.memory.simple import SimpleMemory
|
||||
from langchain_core.legacy.memory.summary import ConversationSummaryMemory
|
||||
@@ -28,15 +24,12 @@ __all__ = [
|
||||
"ConversationBufferMemory",
|
||||
"ConversationBufferWindowMemory",
|
||||
"ConversationEntityMemory",
|
||||
"ConversationKGMemory",
|
||||
"ConversationStringBufferMemory",
|
||||
"ConversationSummaryBufferMemory",
|
||||
"ConversationSummaryMemory",
|
||||
"ConversationTokenBufferMemory",
|
||||
"InMemoryEntityStore",
|
||||
"ReadOnlySharedMemory",
|
||||
"RedisEntityStore",
|
||||
"SQLiteEntityStore",
|
||||
"SimpleMemory",
|
||||
"VectorStoreRetrieverMemory",
|
||||
]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from langchain_core.legacy.memory import BaseChatMemory, BaseMemory
|
||||
from langchain_core.legacy.memory.base import BaseMemory
|
||||
from langchain_core.legacy.memory.chat_memory import BaseChatMemory
|
||||
from langchain_core.legacy.memory.utils import get_prompt_input_key
|
||||
from langchain_core.messages import BaseMessage, get_buffer_string
|
||||
from langchain_core.pydantic_v1 import root_validator
|
||||
|
||||
@@ -2,8 +2,6 @@ import logging
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from langchain_core.language_models import BaseLanguageModel
|
||||
from langchain_core.legacy.chains import LLMChain
|
||||
from langchain_core.legacy.memory import BaseChatMemory
|
||||
@@ -14,7 +12,7 @@ from langchain_core.legacy.memory.prompt import (
|
||||
from langchain_core.legacy.memory.utils import get_prompt_input_key
|
||||
from langchain_core.messages import BaseMessage, get_buffer_string
|
||||
from langchain_core.prompts import BasePromptTemplate
|
||||
from langchain_core.pydantic_v1 import BaseModel
|
||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from typing import List
|
||||
|
||||
import pytest
|
||||
|
||||
from langchain_core.memory import CombinedMemory, ConversationBufferMemory
|
||||
from langchain_core.legacy.memory import CombinedMemory, ConversationBufferMemory
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
|
||||
Reference in New Issue
Block a user