Skip to content

Conversation

jpfcabral
Copy link

@jpfcabral jpfcabral commented Sep 11, 2025

Fixes: #280 #312 #271 #235 #233 #194 #177

Added:

  • Client header injection by RunnableConfig

Example:

await graph.ainvoke(input, config={"configurable": {"jwt": "abc"}})

await graph.ainvoke(input, config={"configurable": {"mcp_headers": {"x-functions-key": "abc"}}}

await tool.ainvoke(input, config={"configurable": {"jwt": "abc"}})

await tool.ainvoke(input, config={"configurable": {"mcp_headers": {"x-functions-key": "abc"}}}

It should work for any langchain runnable (chains, chatmodels, tools, etc)

Reference:
https://python.langchain.com/api_reference/core/runnables/langchain_core.runnables.config.RunnableConfig.html
https://python.langchain.com/docs/how_to/tool_configure/

@jpfcabral jpfcabral changed the title Add Dynamic Header by Langchain RunnableConfig Add Dynamic/Runtime Header by Langchain RunnableConfig Sep 11, 2025
Copy link
Collaborator

@eyurtsev eyurtsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jpfcabral thanks for the PR. This design is not configurable on a per tool basis.

We're likely going to this using an interceptor pattern

@jpfcabral
Copy link
Author

Awesome, @eyurtsev !!! interceptor pattern will be better as #313 implementation only solves the problem of dynamic headers, which is blocking production scenarios for app based services!

Hoping final solution soon!! 😃 tks

@jzus19
Copy link

jzus19 commented Oct 8, 2025

@eyurtsev when to expect solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] Allow HTTP headers to be supplied dynamically
3 participants