Closed robertoshimizu closed 10 months ago
@robertoshimizu that's correct you should not include invoke
. The client appends the appropriate path sufffix (invoke/batch/stream) based on the method that you're using.
the client can do
chain.invoke
chain.ainvoke
chain.batch
chain.abatch
chain.stream
chain.astream
chain.astream_log
Would not be a good experience if changing between batch/stream/invoke required one to also modify the underlying URL.
Is there a good place in the documentation you'd like to see this in?
Thanks for the response Eugene.
I guess a good place would be exactly where it is today, i.e., where it is explained the Client methods to make the various calls. Just make sure the url is clean.
Best RS
This fixed the issue: https://github.com/langchain-ai/langserve/pull/226
Sorry didn't put it together that that was the typescript example provided in the README
It seems that adding the word
invoke
at the and of the url, it gets duplicated when hitting the server.Here what I get when keeping the word
invoke
as per documentation:INFO: 192.168.0.147:52826 - "POST /chain/invoke/invoke HTTP/1.1" 404 Not Found
And here what I get when I supress the word
invoke
, i.e., url is justhttp://localhost:8000/chain/
:INFO: 192.168.0.147:52848 - "POST /chain/invoke HTTP/1.1" 200 OK
It seems that when calling the method
invoke
, langserve already add the wordinvoke
at the end of the url, under the hood. In conclusion, suggest to confirm if my observation makes sense, and if so, adjust the documentation. Best, Roberto