langchain-ai / opengpts

MIT License
6.31k stars 827 forks source link

langserve version issues #112

Open moop6535 opened 6 months ago

moop6535 commented 6 months ago

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

Kaizoku99 commented 6 months ago

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

moop6535 commented 6 months ago

@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

kevinNejad commented 5 months ago

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