langchain-ai
langchain
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
fix(core): `_parse_google_docstring` mishandling continuation lines with colons (#35680) ## Description `_parse_google_docstring` incorrectly parses multi-line argument descriptions when a continuation line contains a colon. The continuation line is treated as a new argument definition instead of being appended to the current argument's description. ### Example ```python def search(query: str, top_k: int = 5) -> str: """Search the knowledge base. Args: query: The search query to use for finding things: important ones top_k: Number of results to return """ ``` **Before (broken):** The parser creates 3 args: `query`, `for finding things`, `top_k` **After (fixed):** The parser correctly creates 2 args: `query` (with full description including "for finding things: important ones"), `top_k` ### Root Cause The parser used `if ":" in line` to detect new argument lines without considering indentation. In Google-style docstrings, continuation lines have deeper indentation than argument definition lines. ### Fix Detect the base indentation level from the first argument line and treat any line with deeper indentation as a continuation of the current argument's description, regardless of whether it contains a colon. ## Issue Fixes #35679 ## Dependencies None. ## Testing Added 4 unit tests in `test_function_calling.py::TestParseGoogleDocstring`: - `test_continuation_line_with_colon` — the core bug scenario - `test_simple_args_still_work` — regression check for basic args - `test_continuation_line_without_colon` — multi-line descriptions without colons - `test_multiple_continuation_lines_with_colons` — multiple continuation lines each containing colons All tests pass locally with Python 3.12. --------- Co-authored-by: gambletan <ethanchang32@gmail.com> Co-authored-by: Mason Daugherty <github@mdrxy.com>
master
3 hours ago
chore(langchain): add types in agent middleware tests (#38188) Co-authored-by: Mason Daugherty <github@mdrxy.com> Co-authored-by: Mason Daugherty <mason@langchain.dev>
master
3 hours ago
fix(core): add messages to bare `raise ValueError` calls (#38158) Closes #35727 --- Several internal code paths raised a bare `ValueError` with no message, so when one of these conditions tripped, users saw a traceback with no explanation of what actually went wrong. This adds descriptive messages to each of those `raise ValueError` calls: - `FewShotPromptWithTemplates._get_examples` / `_aget_examples` — when neither `examples` nor `example_selector` is set. - Prompt `loading` — when a referenced template file uses an unsupported (non-`.txt`) format. - The LangSmith document loader — when both `client` and `client_kwargs` are supplied. - The Anthropic file-search middleware brace expansion — for unbalanced or empty brace patterns. Made by [Open SWE](https://openswe.vercel.app) --------- Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
master
3 hours ago
fix(core): use `asyncio.get_running_loop()` in async contexts (#38157) Closes #35726 --- Several async functions called `asyncio.get_event_loop()`, which has been deprecated since Python 3.10. Inside `async def` bodies the loop is always running, so `asyncio.get_running_loop()` is the correct, warning-free replacement with no behavior change. This updates the call in `_ahandle_event_for_handler` (core callbacks), `_render_mermaid_using_pyppeteer` (core runnables graph), and `async_api_key_wrapper` (`langchain-openai` client utils). Users running on modern Python no longer see `DeprecationWarning`s from these paths. Made by [Open SWE](https://openswe.vercel.app) Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
master
3 hours ago
cr
alvinttang:fix/parse-docstring-continuation-colon-v2
5 hours ago
fix(langchain,openai): only set `strict=True` on tools for OpenAI-compatible models in `ProviderStrategy` (#38370) When using `ProviderStrategy`, `create_agent` unnecessarily sets `strict=True` on tools for all providers. This is only needed for OpenAI / chat completions. Here we unset `strict`. For OpenAI: 1. We set it in `BaseChatOpenAI.bind_tools` (as a convenience to users calling `model.bind_tools` directly) 2. We (redundantly) special-case OpenAI in the `create_agent` factory logic so that things will not break for users who upgrade `langchain` but not `langchain-openai`. Note: payloads for OpenAI are tested here and appear unchanged: https://github.com/langchain-ai/langchain/blob/master/libs/langchain_v1/tests/unit_tests/agents/test_response_format_integration.py Quick test: ```python from langchain.agents import create_agent from langchain.agents.structured_output import ProviderStrategy from pydantic import BaseModel class Weather(BaseModel): temperature: float condition: str def weather_tool(location: str) -> str: """Get the weather at a location.""" return "Sunny and 75 degrees F." for model in [ "anthropic:claude-sonnet-4-6", "openai:gpt-5.4", "google_genai:gemini-3.5-flash", ]: agent = create_agent( model=model, tools=[weather_tool], response_format=ProviderStrategy(Weather), ) result = agent.invoke({ "messages": [{"role": "user", "content": "What's the weather in SF?"}] }) print(result["structured_response"]) ```
master
5 hours ago
release(langchain): 1.3.11 (#38377)
master
5 hours ago
release(langchain): 1.3.11
mdrxy/release-langchain-1-3-11
5 hours ago
Latest Branches
CodSpeed Performance Gauge
0%
fix(core): `_parse_google_docstring` mishandling continuation lines with colons
#35680
15 hours ago
db7a398
alvinttang:fix/parse-docstring-continuation-colon-v2
CodSpeed Performance Gauge
0%
release(langchain): 1.3.11
#38377
21 hours ago
463f5a1
mdrxy/release-langchain-1-3-11
CodSpeed Performance Gauge
0%
fix(core): add messages to bare `raise ValueError` calls
#38158
17 hours ago
e0abd63
mdrxy/core/bare-valueerror-messages
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs