opengpts icon indicating copy to clipboard operation
opengpts copied to clipboard

langserve version issues

Open moop6535 opened this issue 1 year ago • 3 comments

Wanted to drop a friendly note here.

Setting up the backend, I was running into this issue:

ImportError: cannot import name '_get_base_run_id_as_str' from 'langserve.server' (/opt/opengpts/backend/.venv/lib/python3.11/site-packages/langserve/server.py)

python: 3.11.7 pip: 23.3.1

I noticed the issue came from the requirements: langserve>=0.0.23

Which was installing langserve 0.0.36

I checked the Docker build (which was working) and the langserve version was 0.0.32

Of course, the issue has to do with the new change in langserve, but for other folks out there the quick fix is to change the requirements.txt to hardcode the langserve version: langserve==0.0.32

moop6535 avatar Dec 14 '23 19:12 moop6535

can You please give more explanation on how to fix this issue? because I keep running into it even after I changed the requirements.txt to hardcode the langserve version: langserve==0.0.32

Kaizoku99 avatar Dec 15 '23 06:12 Kaizoku99

@Kaizoku99

Here is my requirements.txt that is working for me:

langchain-cli
-e packages/gizmo-agent
-e packages/agent-executor
langchain>=0.0.331
langserve==0.0.32
langsmith==0.0.70
permchain
python-multipart

I also hard set langsmith==0.0.70 (and python version 3.11.7)

Let me know if that works for you

moop6535 avatar Dec 15 '23 17:12 moop6535

quick fix from langserve.api_handler import _get_base_run_id_as_str, _unpack_input replace server with api_handler

kevinNejad avatar Jan 07 '24 16:01 kevinNejad