Skip to content

feat(core): forward bound kwargs in RunnableBinding.__getattr__#35322

Open
Mohammad Mohtashim (keenborder786) wants to merge 7 commits intolangchain-ai:masterfrom
keenborder786:mmk/bound_parameters
Open

feat(core): forward bound kwargs in RunnableBinding.__getattr__#35322
Mohammad Mohtashim (keenborder786) wants to merge 7 commits intolangchain-ai:masterfrom
keenborder786:mmk/bound_parameters

Conversation

@keenborder786
Copy link
Copy Markdown
Contributor

  • RunnableBinding.getattr now forwards bound kwargs to delegated methods that accept **kwargs.
  • Previously, only bound config was passed to the underlying runnable's methods. Now, bound kwargs are also forwarded to methods with **kwargs, with explicit kwargs taking precedence.
runnable.bind(foo="bar").some_method(baz="qux")
# some_method receives: foo="bar", baz="qux"

Use case was identified in #35320

@github-actions github-actions Bot added core `langchain-core` package issues & PRs external feature For PRs that implement a new feature; NOT A FEATURE REQUEST labels Feb 19, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Feb 20, 2026

Merging this PR will improve performance by 25.43%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 1 improved benchmark
✅ 12 untouched benchmarks
⏩ 27 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime test_async_callbacks_in_sync 20.5 ms 16.3 ms +25.43%

Comparing keenborder786:mmk/bound_parameters (6e139e2) with master (90d015c)

Open in CodSpeed

Footnotes

  1. 27 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions github-actions Bot added the size: S 50-199 LOC label Mar 9, 2026
@langchain-automated-triage langchain-automated-triage Bot added the trusted-contributor >= 5 merged PRs in the `langchain-ai/langchain` repo label Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core `langchain-core` package issues & PRs external feature For PRs that implement a new feature; NOT A FEATURE REQUEST size: S 50-199 LOC trusted-contributor >= 5 merged PRs in the `langchain-ai/langchain` repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants