mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-14 05:56:40 +00:00
multiple: update removal targets (#25361)
This commit is contained in:
@@ -220,7 +220,7 @@ class BaseLanguageModel(
|
||||
# generate responses that match a given schema.
|
||||
raise NotImplementedError()
|
||||
|
||||
@deprecated("0.1.7", alternative="invoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="invoke", removal="1.0")
|
||||
@abstractmethod
|
||||
def predict(
|
||||
self, text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any
|
||||
@@ -241,7 +241,7 @@ class BaseLanguageModel(
|
||||
Top model prediction as a string.
|
||||
"""
|
||||
|
||||
@deprecated("0.1.7", alternative="invoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="invoke", removal="1.0")
|
||||
@abstractmethod
|
||||
def predict_messages(
|
||||
self,
|
||||
@@ -266,7 +266,7 @@ class BaseLanguageModel(
|
||||
Top model prediction as a message.
|
||||
"""
|
||||
|
||||
@deprecated("0.1.7", alternative="ainvoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="ainvoke", removal="1.0")
|
||||
@abstractmethod
|
||||
async def apredict(
|
||||
self, text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any
|
||||
@@ -287,7 +287,7 @@ class BaseLanguageModel(
|
||||
Top model prediction as a string.
|
||||
"""
|
||||
|
||||
@deprecated("0.1.7", alternative="ainvoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="ainvoke", removal="1.0")
|
||||
@abstractmethod
|
||||
async def apredict_messages(
|
||||
self,
|
||||
|
@@ -209,7 +209,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
||||
""" # noqa: E501
|
||||
|
||||
callback_manager: Optional[BaseCallbackManager] = deprecated(
|
||||
name="callback_manager", since="0.1.7", removal="0.3.0", alternative="callbacks"
|
||||
name="callback_manager", since="0.1.7", removal="1.0", alternative="callbacks"
|
||||
)(
|
||||
Field(
|
||||
default=None,
|
||||
@@ -1019,7 +1019,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
||||
break
|
||||
yield item # type: ignore[misc]
|
||||
|
||||
@deprecated("0.1.7", alternative="invoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="invoke", removal="1.0")
|
||||
def __call__(
|
||||
self,
|
||||
messages: List[BaseMessage],
|
||||
@@ -1051,13 +1051,13 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
||||
else:
|
||||
raise ValueError("Unexpected generation type")
|
||||
|
||||
@deprecated("0.1.7", alternative="invoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="invoke", removal="1.0")
|
||||
def call_as_llm(
|
||||
self, message: str, stop: Optional[List[str]] = None, **kwargs: Any
|
||||
) -> str:
|
||||
return self.predict(message, stop=stop, **kwargs)
|
||||
|
||||
@deprecated("0.1.7", alternative="invoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="invoke", removal="1.0")
|
||||
def predict(
|
||||
self, text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any
|
||||
) -> str:
|
||||
@@ -1071,7 +1071,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
||||
else:
|
||||
raise ValueError("Cannot use predict when output is not a string.")
|
||||
|
||||
@deprecated("0.1.7", alternative="invoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="invoke", removal="1.0")
|
||||
def predict_messages(
|
||||
self,
|
||||
messages: List[BaseMessage],
|
||||
@@ -1085,7 +1085,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
||||
_stop = list(stop)
|
||||
return self(messages, stop=_stop, **kwargs)
|
||||
|
||||
@deprecated("0.1.7", alternative="ainvoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="ainvoke", removal="1.0")
|
||||
async def apredict(
|
||||
self, text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any
|
||||
) -> str:
|
||||
@@ -1101,7 +1101,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
||||
else:
|
||||
raise ValueError("Cannot use predict when output is not a string.")
|
||||
|
||||
@deprecated("0.1.7", alternative="ainvoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="ainvoke", removal="1.0")
|
||||
async def apredict_messages(
|
||||
self,
|
||||
messages: List[BaseMessage],
|
||||
|
@@ -1150,7 +1150,7 @@ class BaseLLM(BaseLanguageModel[str], ABC):
|
||||
generations = [existing_prompts[i] for i in range(len(prompts))]
|
||||
return LLMResult(generations=generations, llm_output=llm_output, run=run_info)
|
||||
|
||||
@deprecated("0.1.7", alternative="invoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="invoke", removal="1.0")
|
||||
def __call__(
|
||||
self,
|
||||
prompt: str,
|
||||
@@ -1220,7 +1220,7 @@ class BaseLLM(BaseLanguageModel[str], ABC):
|
||||
)
|
||||
return result.generations[0][0].text
|
||||
|
||||
@deprecated("0.1.7", alternative="invoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="invoke", removal="1.0")
|
||||
def predict(
|
||||
self, text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any
|
||||
) -> str:
|
||||
@@ -1230,7 +1230,7 @@ class BaseLLM(BaseLanguageModel[str], ABC):
|
||||
_stop = list(stop)
|
||||
return self(text, stop=_stop, **kwargs)
|
||||
|
||||
@deprecated("0.1.7", alternative="invoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="invoke", removal="1.0")
|
||||
def predict_messages(
|
||||
self,
|
||||
messages: List[BaseMessage],
|
||||
@@ -1246,7 +1246,7 @@ class BaseLLM(BaseLanguageModel[str], ABC):
|
||||
content = self(text, stop=_stop, **kwargs)
|
||||
return AIMessage(content=content)
|
||||
|
||||
@deprecated("0.1.7", alternative="ainvoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="ainvoke", removal="1.0")
|
||||
async def apredict(
|
||||
self, text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any
|
||||
) -> str:
|
||||
@@ -1256,7 +1256,7 @@ class BaseLLM(BaseLanguageModel[str], ABC):
|
||||
_stop = list(stop)
|
||||
return await self._call_async(text, stop=_stop, **kwargs)
|
||||
|
||||
@deprecated("0.1.7", alternative="ainvoke", removal="0.3.0")
|
||||
@deprecated("0.1.7", alternative="ainvoke", removal="1.0")
|
||||
async def apredict_messages(
|
||||
self,
|
||||
messages: List[BaseMessage],
|
||||
|
@@ -349,7 +349,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC):
|
||||
run_manager=run_manager.get_sync(),
|
||||
)
|
||||
|
||||
@deprecated(since="0.1.46", alternative="invoke", removal="0.3.0")
|
||||
@deprecated(since="0.1.46", alternative="invoke", removal="1.0")
|
||||
def get_relevant_documents(
|
||||
self,
|
||||
query: str,
|
||||
@@ -393,7 +393,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC):
|
||||
config["run_name"] = run_name
|
||||
return self.invoke(query, config, **kwargs)
|
||||
|
||||
@deprecated(since="0.1.46", alternative="ainvoke", removal="0.3.0")
|
||||
@deprecated(since="0.1.46", alternative="ainvoke", removal="1.0")
|
||||
async def aget_relevant_documents(
|
||||
self,
|
||||
query: str,
|
||||
|
@@ -332,7 +332,7 @@ class ChildTool(BaseTool):
|
||||
"""Callbacks to be called during tool execution."""
|
||||
|
||||
callback_manager: Optional[BaseCallbackManager] = deprecated(
|
||||
name="callback_manager", since="0.1.7", removal="0.3.0", alternative="callbacks"
|
||||
name="callback_manager", since="0.1.7", removal="1.0", alternative="callbacks"
|
||||
)(
|
||||
Field(
|
||||
default=None,
|
||||
@@ -740,7 +740,7 @@ class ChildTool(BaseTool):
|
||||
await run_manager.on_tool_end(output, color=color, name=self.name, **kwargs)
|
||||
return output
|
||||
|
||||
@deprecated("0.1.47", alternative="invoke", removal="0.3.0")
|
||||
@deprecated("0.1.47", alternative="invoke", removal="1.0")
|
||||
def __call__(self, tool_input: str, callbacks: Callbacks = None) -> str:
|
||||
"""Make tool callable."""
|
||||
return self.run(tool_input, callbacks=callbacks)
|
||||
|
@@ -15,7 +15,7 @@ from langchain_core.outputs import LLMResult
|
||||
from langchain_core.pydantic_v1 import BaseModel, Field, root_validator
|
||||
|
||||
|
||||
@deprecated("0.1.0", alternative="Use string instead.", removal="0.3.0")
|
||||
@deprecated("0.1.0", alternative="Use string instead.", removal="1.0")
|
||||
def RunTypeEnum() -> Type[RunTypeEnumDep]:
|
||||
"""RunTypeEnum."""
|
||||
warnings.warn(
|
||||
@@ -26,7 +26,7 @@ def RunTypeEnum() -> Type[RunTypeEnumDep]:
|
||||
return RunTypeEnumDep
|
||||
|
||||
|
||||
@deprecated("0.1.0", removal="0.3.0")
|
||||
@deprecated("0.1.0", removal="1.0")
|
||||
class TracerSessionV1Base(BaseModel):
|
||||
"""Base class for TracerSessionV1."""
|
||||
|
||||
@@ -35,33 +35,33 @@ class TracerSessionV1Base(BaseModel):
|
||||
extra: Optional[Dict[str, Any]] = None
|
||||
|
||||
|
||||
@deprecated("0.1.0", removal="0.3.0")
|
||||
@deprecated("0.1.0", removal="1.0")
|
||||
class TracerSessionV1Create(TracerSessionV1Base):
|
||||
"""Create class for TracerSessionV1."""
|
||||
|
||||
|
||||
@deprecated("0.1.0", removal="0.3.0")
|
||||
@deprecated("0.1.0", removal="1.0")
|
||||
class TracerSessionV1(TracerSessionV1Base):
|
||||
"""TracerSessionV1 schema."""
|
||||
|
||||
id: int
|
||||
|
||||
|
||||
@deprecated("0.1.0", removal="0.3.0")
|
||||
@deprecated("0.1.0", removal="1.0")
|
||||
class TracerSessionBase(TracerSessionV1Base):
|
||||
"""Base class for TracerSession."""
|
||||
|
||||
tenant_id: UUID
|
||||
|
||||
|
||||
@deprecated("0.1.0", removal="0.3.0")
|
||||
@deprecated("0.1.0", removal="1.0")
|
||||
class TracerSession(TracerSessionBase):
|
||||
"""TracerSessionV1 schema for the V2 API."""
|
||||
|
||||
id: UUID
|
||||
|
||||
|
||||
@deprecated("0.1.0", alternative="Run", removal="0.3.0")
|
||||
@deprecated("0.1.0", alternative="Run", removal="1.0")
|
||||
class BaseRun(BaseModel):
|
||||
"""Base class for Run."""
|
||||
|
||||
@@ -77,7 +77,7 @@ class BaseRun(BaseModel):
|
||||
error: Optional[str] = None
|
||||
|
||||
|
||||
@deprecated("0.1.0", alternative="Run", removal="0.3.0")
|
||||
@deprecated("0.1.0", alternative="Run", removal="1.0")
|
||||
class LLMRun(BaseRun):
|
||||
"""Class for LLMRun."""
|
||||
|
||||
@@ -85,7 +85,7 @@ class LLMRun(BaseRun):
|
||||
response: Optional[LLMResult] = None
|
||||
|
||||
|
||||
@deprecated("0.1.0", alternative="Run", removal="0.3.0")
|
||||
@deprecated("0.1.0", alternative="Run", removal="1.0")
|
||||
class ChainRun(BaseRun):
|
||||
"""Class for ChainRun."""
|
||||
|
||||
@@ -96,7 +96,7 @@ class ChainRun(BaseRun):
|
||||
child_tool_runs: List[ToolRun] = Field(default_factory=list)
|
||||
|
||||
|
||||
@deprecated("0.1.0", alternative="Run", removal="0.3.0")
|
||||
@deprecated("0.1.0", alternative="Run", removal="1.0")
|
||||
class ToolRun(BaseRun):
|
||||
"""Class for ToolRun."""
|
||||
|
||||
|
@@ -81,7 +81,7 @@ def _rm_titles(kv: dict, prev_key: str = "") -> dict:
|
||||
@deprecated(
|
||||
"0.1.16",
|
||||
alternative="langchain_core.utils.function_calling.convert_to_openai_function()",
|
||||
removal="0.3.0",
|
||||
removal="1.0",
|
||||
)
|
||||
def convert_pydantic_to_openai_function(
|
||||
model: Type[BaseModel],
|
||||
@@ -121,7 +121,7 @@ def convert_pydantic_to_openai_function(
|
||||
@deprecated(
|
||||
"0.1.16",
|
||||
alternative="langchain_core.utils.function_calling.convert_to_openai_tool()",
|
||||
removal="0.3.0",
|
||||
removal="1.0",
|
||||
)
|
||||
def convert_pydantic_to_openai_tool(
|
||||
model: Type[BaseModel],
|
||||
@@ -155,7 +155,7 @@ def _get_python_function_name(function: Callable) -> str:
|
||||
@deprecated(
|
||||
"0.1.16",
|
||||
alternative="langchain_core.utils.function_calling.convert_to_openai_function()",
|
||||
removal="0.3.0",
|
||||
removal="1.0",
|
||||
)
|
||||
def convert_python_function_to_openai_function(
|
||||
function: Callable,
|
||||
@@ -268,7 +268,7 @@ def _convert_any_typed_dicts_to_pydantic(
|
||||
@deprecated(
|
||||
"0.1.16",
|
||||
alternative="langchain_core.utils.function_calling.convert_to_openai_function()",
|
||||
removal="0.3.0",
|
||||
removal="1.0",
|
||||
)
|
||||
def format_tool_to_openai_function(tool: BaseTool) -> FunctionDescription:
|
||||
"""Format tool into the OpenAI function API.
|
||||
@@ -305,7 +305,7 @@ def format_tool_to_openai_function(tool: BaseTool) -> FunctionDescription:
|
||||
@deprecated(
|
||||
"0.1.16",
|
||||
alternative="langchain_core.utils.function_calling.convert_to_openai_tool()",
|
||||
removal="0.3.0",
|
||||
removal="1.0",
|
||||
)
|
||||
def format_tool_to_openai_tool(tool: BaseTool) -> ToolDescription:
|
||||
"""Format tool into the OpenAI function API.
|
||||
|
@@ -8,7 +8,7 @@ from langchain_core._api.deprecation import deprecated
|
||||
|
||||
@deprecated(
|
||||
since="0.1.30",
|
||||
removal="0.3",
|
||||
removal="1.0",
|
||||
message=(
|
||||
"Using the hwchase17/langchain-hub "
|
||||
"repo for prompts is deprecated. Please use "
|
||||
|
@@ -154,7 +154,7 @@ class InMemoryVectorStore(VectorStore):
|
||||
"It'll be removed in 0.3.0."
|
||||
),
|
||||
since="0.2.29",
|
||||
removal="0.3.0",
|
||||
removal="1.0",
|
||||
)
|
||||
def upsert(self, items: Sequence[Document], /, **kwargs: Any) -> UpsertResponse:
|
||||
vectors = self.embedding.embed_documents([item.page_content for item in items])
|
||||
@@ -180,7 +180,7 @@ class InMemoryVectorStore(VectorStore):
|
||||
"It'll be removed in 0.3.0."
|
||||
),
|
||||
since="0.2.29",
|
||||
removal="0.3.0",
|
||||
removal="1.0",
|
||||
)
|
||||
async def aupsert(
|
||||
self, items: Sequence[Document], /, **kwargs: Any
|
||||
|
Reference in New Issue
Block a user