{"id":441,"library":"langchain-core","title":"LangChain Core Library","description":"LangChain Core is a Python library designed to facilitate the development of applications using Large Language Models (LLMs) through composability. The current version is 1.2.23, and it follows a regular release cadence with frequent updates and improvements.","status":"active","version":"1.2.23","language":"python","source_language":"en","source_url":"https://github.com/langchain-ai/langchain","tags":["LLM","composability","Python","library","AI"],"install":[{"cmd":"pip install langchain-core","lang":"bash","label":"Install LangChain Core"}],"dependencies":[{"reason":"HTTP library for making requests","package":"requests","optional":false}],"imports":[{"note":"Ensure correct import path to avoid deprecation warnings","symbol":"SomeClass","correct":"from langchain_core import SomeClass"}],"quickstart":{"code":"import os\nfrom langchain_core import SomeClass\n\n# Initialize the class with necessary parameters\nsome_instance = SomeClass(param1=os.environ.get('PARAM1'), param2=os.environ.get('PARAM2'))\n\n# Use the instance to perform tasks\nresult = some_instance.perform_task()\nprint(result)","lang":"python","description":"A basic example demonstrating how to initialize and use a class from langchain_core."},"warnings":[{"fix":"Upgrade to Pydantic 2.x to maintain compatibility.","message":"Deprecation of Pydantic 1.x support","severity":"breaking","affected_versions":"1.2.0 to 1.2.22"},{"fix":"Update import statements to reflect the new module structure.","message":"Import paths have changed in recent versions","severity":"gotcha","affected_versions":"1.2.0 to 1.2.23"}],"env_vars":null,"last_verified":"2026-05-12T13:50:45.325Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Install the missing package using pip. For `langchain_community`, run: `pip install langchain-community` (and similarly for other specific integration packages like `langchain-openai`).","cause":"The LangChain library has been modularized. Components that were previously part of the main `langchain` package are now distributed in separate, specific packages like `langchain-community`, `langchain-openai`, etc., and must be installed explicitly.","error":"ModuleNotFoundError: No module named 'langchain_community'"},{"fix":"Instead of `langchain.debug = True`, use `from langchain_core.globals import set_debug; set_debug(True)` or enable tracing with LangSmith by setting relevant environment variables (`LANGCHAIN_TRACING_V2=true`, `LANGCHAIN_API_KEY`, `LANGCHAIN_PROJECT`).","cause":"The global `debug` setting, previously accessible via `langchain.debug`, has been deprecated or moved. LangChain now encourages using `langchain.set_debug(True)` or LangSmith for tracing and debugging.","error":"AttributeError: module 'langchain' has no attribute 'debug'"},{"fix":"Remove the trailing comma when initializing the LLM instance to ensure it is an object and not a tuple. For example, change `llm = ChatOpenAI(model='gpt-4o'),` to `llm = ChatOpenAI(model='gpt-4o')`.","cause":"This error commonly occurs when an LLM instance (e.g., `ChatOpenAI`) is accidentally initialized as a single-element tuple due to a trailing comma in its declaration, preventing direct method calls like `invoke()`.","error":"AttributeError: 'tuple' object has no attribute 'invoke'"},{"fix":"Ensure the input prompt matches the expected type for the specific LLM or chain. If using a chat model like `ChatOpenAI`, pass a list of messages (e.g., `[HumanMessage(content='your prompt')]`). If using an older `OpenAI` text completion model, pass a simple string.","cause":"This error typically arises when an LLM or a chain expects a single string as a prompt input but receives a list of message objects (a 'sequence'), or vice versa. This often happens due to a mismatch between using a classic `OpenAI` LLM (string-in) and a `ChatOpenAI` model (list-of-messages-in).","error":"UnprocessableEntityError: Failed to deserialize the JSON body into the target type: prompt: invalid type: sequence, expected a string at line 1 column 3"}],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}