mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-10 21:35:08 +00:00
multiple[patch]: fix deprecation versions (#18349)
This commit is contained in:
parent
11cb42c2c1
commit
eefb49680f
@ -1,4 +1,5 @@
|
|||||||
"""Azure OpenAI embeddings wrapper."""
|
"""Azure OpenAI embeddings wrapper."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@ -14,7 +15,7 @@ from langchain_community.utils.openai import is_openai_v1
|
|||||||
|
|
||||||
|
|
||||||
@deprecated(
|
@deprecated(
|
||||||
since="0.1.0",
|
since="0.0.9",
|
||||||
removal="0.2.0",
|
removal="0.2.0",
|
||||||
alternative_import="langchain_openai.AzureOpenAIEmbeddings",
|
alternative_import="langchain_openai.AzureOpenAIEmbeddings",
|
||||||
)
|
)
|
||||||
|
@ -139,7 +139,7 @@ async def async_embed_with_retry(embeddings: OpenAIEmbeddings, **kwargs: Any) ->
|
|||||||
|
|
||||||
|
|
||||||
@deprecated(
|
@deprecated(
|
||||||
since="0.1.0",
|
since="0.0.9",
|
||||||
removal="0.2.0",
|
removal="0.2.0",
|
||||||
alternative_import="langchain_openai.OpenAIEmbeddings",
|
alternative_import="langchain_openai.OpenAIEmbeddings",
|
||||||
)
|
)
|
||||||
|
@ -59,7 +59,7 @@ def _strip_erroneous_leading_spaces(text: str) -> str:
|
|||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
||||||
@deprecated("0.0.351", alternative_import="langchain_google_genai.GoogleGenerativeAI")
|
@deprecated("0.0.12", alternative_import="langchain_google_genai.GoogleGenerativeAI")
|
||||||
class GooglePalm(BaseLLM, BaseModel):
|
class GooglePalm(BaseLLM, BaseModel):
|
||||||
"""
|
"""
|
||||||
DEPRECATED: Use `langchain_google_genai.GoogleGenerativeAI` instead.
|
DEPRECATED: Use `langchain_google_genai.GoogleGenerativeAI` instead.
|
||||||
|
@ -120,7 +120,7 @@ class _UpstashRedisStore(BaseStore[str, str]):
|
|||||||
yield key
|
yield key
|
||||||
|
|
||||||
|
|
||||||
@deprecated("0.0.335", alternative="UpstashRedisByteStore")
|
@deprecated("0.0.1", alternative="UpstashRedisByteStore")
|
||||||
class UpstashRedisStore(_UpstashRedisStore):
|
class UpstashRedisStore(_UpstashRedisStore):
|
||||||
"""
|
"""
|
||||||
BaseStore implementation using Upstash Redis
|
BaseStore implementation using Upstash Redis
|
||||||
|
@ -358,7 +358,7 @@ class ElasticVectorSearch(VectorStore):
|
|||||||
self.client.delete(index=self.index_name, id=id)
|
self.client.delete(index=self.index_name, id=id)
|
||||||
|
|
||||||
|
|
||||||
@deprecated("0.0.265", alternative="ElasticsearchStore class.", pending=True)
|
@deprecated("0.0.1", alternative="ElasticsearchStore class.", pending=True)
|
||||||
class ElasticKnnSearch(VectorStore):
|
class ElasticKnnSearch(VectorStore):
|
||||||
"""[DEPRECATED] `Elasticsearch` with k-nearest neighbor search
|
"""[DEPRECATED] `Elasticsearch` with k-nearest neighbor search
|
||||||
(`k-NN`) vector store.
|
(`k-NN`) vector store.
|
||||||
@ -564,9 +564,11 @@ class ElasticKnnSearch(VectorStore):
|
|||||||
docs_and_scores = [
|
docs_and_scores = [
|
||||||
(
|
(
|
||||||
Document(
|
Document(
|
||||||
page_content=hit["_source"][page_content]
|
page_content=(
|
||||||
if source
|
hit["_source"][page_content]
|
||||||
else hit["fields"][page_content][0],
|
if source
|
||||||
|
else hit["fields"][page_content][0]
|
||||||
|
),
|
||||||
metadata=hit["fields"] if fields else {},
|
metadata=hit["fields"] if fields else {},
|
||||||
),
|
),
|
||||||
hit["_score"],
|
hit["_score"],
|
||||||
@ -647,9 +649,11 @@ class ElasticKnnSearch(VectorStore):
|
|||||||
docs_and_scores = [
|
docs_and_scores = [
|
||||||
(
|
(
|
||||||
Document(
|
Document(
|
||||||
page_content=hit["_source"][page_content]
|
page_content=(
|
||||||
if source
|
hit["_source"][page_content]
|
||||||
else hit["fields"][page_content][0],
|
if source
|
||||||
|
else hit["fields"][page_content][0]
|
||||||
|
),
|
||||||
metadata=hit["fields"] if fields else {},
|
metadata=hit["fields"] if fields else {},
|
||||||
),
|
),
|
||||||
hit["_score"],
|
hit["_score"],
|
||||||
|
@ -742,7 +742,7 @@ class Redis(VectorStore):
|
|||||||
tags.extend(self._get_retriever_tags())
|
tags.extend(self._get_retriever_tags())
|
||||||
return RedisVectorStoreRetriever(vectorstore=self, **kwargs, tags=tags)
|
return RedisVectorStoreRetriever(vectorstore=self, **kwargs, tags=tags)
|
||||||
|
|
||||||
@deprecated("0.0.272", alternative="similarity_search(distance_threshold=0.1)")
|
@deprecated("0.0.1", alternative="similarity_search(distance_threshold=0.1)")
|
||||||
def similarity_search_limit_score(
|
def similarity_search_limit_score(
|
||||||
self, query: str, k: int = 4, score_threshold: float = 0.2, **kwargs: Any
|
self, query: str, k: int = 4, score_threshold: float = 0.2, **kwargs: Any
|
||||||
) -> List[Document]:
|
) -> List[Document]:
|
||||||
|
@ -672,7 +672,7 @@ class ChatPromptTemplate(BaseChatPromptTemplate):
|
|||||||
return cls.from_messages([message])
|
return cls.from_messages([message])
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@deprecated("0.0.260", alternative="from_messages classmethod", pending=True)
|
@deprecated("0.0.1", alternative="from_messages classmethod", pending=True)
|
||||||
def from_role_strings(
|
def from_role_strings(
|
||||||
cls, string_messages: List[Tuple[str, str]]
|
cls, string_messages: List[Tuple[str, str]]
|
||||||
) -> ChatPromptTemplate:
|
) -> ChatPromptTemplate:
|
||||||
@ -692,7 +692,7 @@ class ChatPromptTemplate(BaseChatPromptTemplate):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@deprecated("0.0.260", alternative="from_messages classmethod", pending=True)
|
@deprecated("0.0.1", alternative="from_messages classmethod", pending=True)
|
||||||
def from_strings(
|
def from_strings(
|
||||||
cls, string_messages: List[Tuple[Type[BaseMessagePromptTemplate], str]]
|
cls, string_messages: List[Tuple[Type[BaseMessagePromptTemplate], str]]
|
||||||
) -> ChatPromptTemplate:
|
) -> ChatPromptTemplate:
|
||||||
|
Loading…
Reference in New Issue
Block a user