mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-26 16:43:35 +00:00
community: deprecate community ollama integrations (#26733)
This commit is contained in:
parent
e317d457cf
commit
95a87291fd
@ -47,6 +47,11 @@ def _chat_stream_response_to_chat_generation_chunk(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(
|
||||||
|
since="0.3.1",
|
||||||
|
removal="1.0.0",
|
||||||
|
alternative_import="langchain_ollama.ChatOllama",
|
||||||
|
)
|
||||||
class ChatOllama(BaseChatModel, _OllamaCommon):
|
class ChatOllama(BaseChatModel, _OllamaCommon):
|
||||||
"""Ollama locally runs large language models.
|
"""Ollama locally runs large language models.
|
||||||
|
|
||||||
|
@ -2,12 +2,18 @@ import logging
|
|||||||
from typing import Any, Dict, List, Mapping, Optional
|
from typing import Any, Dict, List, Mapping, Optional
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
from langchain_core._api.deprecation import deprecated
|
||||||
from langchain_core.embeddings import Embeddings
|
from langchain_core.embeddings import Embeddings
|
||||||
from pydantic import BaseModel, ConfigDict
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(
|
||||||
|
since="0.3.1",
|
||||||
|
removal="1.0.0",
|
||||||
|
alternative_import="langchain_ollama.OllamaEmbeddings",
|
||||||
|
)
|
||||||
class OllamaEmbeddings(BaseModel, Embeddings):
|
class OllamaEmbeddings(BaseModel, Embeddings):
|
||||||
"""Ollama locally runs large language models.
|
"""Ollama locally runs large language models.
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ from typing import (
|
|||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import requests
|
import requests
|
||||||
|
from langchain_core._api.deprecation import deprecated
|
||||||
from langchain_core.callbacks import (
|
from langchain_core.callbacks import (
|
||||||
AsyncCallbackManagerForLLMRun,
|
AsyncCallbackManagerForLLMRun,
|
||||||
CallbackManagerForLLMRun,
|
CallbackManagerForLLMRun,
|
||||||
@ -389,6 +390,11 @@ class _OllamaCommon(BaseLanguageModel):
|
|||||||
return final_chunk
|
return final_chunk
|
||||||
|
|
||||||
|
|
||||||
|
@deprecated(
|
||||||
|
since="0.3.1",
|
||||||
|
removal="1.0.0",
|
||||||
|
alternative_import="langchain_ollama.OllamaLLM",
|
||||||
|
)
|
||||||
class Ollama(BaseLLM, _OllamaCommon):
|
class Ollama(BaseLLM, _OllamaCommon):
|
||||||
"""Ollama locally runs large language models.
|
"""Ollama locally runs large language models.
|
||||||
To use, follow the instructions at https://ollama.ai/.
|
To use, follow the instructions at https://ollama.ai/.
|
||||||
|
Loading…
Reference in New Issue
Block a user