Getting this up and running is tricksy
The documentation is minimalist.
Setting up a python env, setting PYTHONPATH, etc. could all do with some hand-holding.
After:
export PYTHONPATH=.
I managed to get langcorn to start with examples.ex1:chain but trying to run the supposed main:app example per the README.md
uvicorn main:app --host 0.0.0.0 --port 8000
Fails with:
uvicorn.importer.ImportFromStringError: Could not import module "main".
Trying:
langcorn server examples.app:app
Fails with
AttributeError: 'FastAPI' object has no attribute 'input_key'
Something obvious that I'm missing?
Hi @verveguy! Thx for reporting these issues.
export PYTHONPATH=.
That's really confusing, I agree. I tried to add sys.path.append(os.path.dirname(__file__)) in the cli code but apparently it did not work.
langcorn server examples.app:app
Fails with
AttributeError: 'FastAPI' object has no attribute 'input_key'
The issue is that langcorn server takes LangChain object as an import string. I am going to make a patch to log a warning.
Intedened usages are either of
uvicorn examples.app:app --host 0.0.0.0 --port 3000
or
langcorn server examples.ex1:chain examples.ex2:chain examples.ex3:chain examples.ex4:sequential_chain
Addressed both issues in 0.0.9
I think the input_key issue is because the property is actually called input_keys