langcorn icon indicating copy to clipboard operation
langcorn copied to clipboard

Getting this up and running is tricksy

Open verveguy opened this issue 2 years ago • 3 comments

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?

verveguy avatar May 13 '23 16:05 verveguy

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

msoedov avatar May 15 '23 11:05 msoedov

Addressed both issues in 0.0.9

msoedov avatar May 15 '23 11:05 msoedov

I think the input_key issue is because the property is actually called input_keys

nb-programmer avatar Jun 29 '23 05:06 nb-programmer