python-sdk icon indicating copy to clipboard operation
python-sdk copied to clipboard

feat: client should handle 307 redirects

Open phact opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. Currently when I stand up an sse client against a server that redirects I get

[2024-12-17 16:40:04,008][ERROR] Error in post_writer: Redirect response '307 Temporary Redirect' for url 'http://localhost:7860/api/v1/mcp?session_id=430eaa669c7a484a892dbd82c805249d' Redirect location: 'http://localhost:7860/api/v1/mcp/?session_id=430eaa669c7a484a892dbd82c805249d' For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307

Describe the solution you'd like I ended up implementing an OPTIONS check before I establish the sse client so that no redirect is necessary but it would be nice for this to be handled automatically.

phact avatar Dec 17 '24 21:12 phact

Hey guys, any news about this?

MartinGotelli avatar Dec 18 '24 14:12 MartinGotelli

Thanks very much for raising this.

I've addressed the issue for the bind_tools hot path specifically in https://github.com/langchain-ai/langchain/pull/29015 (we should not be using deprecated functions there anyway).

To correct the underlying issue, we need to address the latency of the underlying @deprecated decorator. I have a PR for that in https://github.com/langchain-ai/langchain/pull/29016.

ccurme avatar Jan 03 '25 18:01 ccurme