Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting this up and running is tricksy #15

Open
verveguy opened this issue May 13, 2023 · 3 comments
Open

Getting this up and running is tricksy #15

verveguy opened this issue May 13, 2023 · 3 comments

Comments

@verveguy
Copy link

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?

@msoedov
Copy link
Owner

msoedov commented May 15, 2023

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
Copy link
Owner

msoedov commented May 15, 2023

Addressed both issues in 0.0.9

@nb-programmer
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants