mirror of
https://github.com/langchain-ai/langserve.git
synced 2026-07-18 02:51:27 -04:00
Cannot add custom templates with langchain add langchain app add --project-dir #102
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @LifeHackerBee on GitHub (Jan 24, 2024).
I created a langchain app template by using:
However, when I executed
langchain app add --pip --project-dir ./templates/hello-world, it returned as following:as the docs instructed:
langchain cli
Please kindly let me know how to resolve this issue, thanks in advance.
Best,
Levon
@alexnodeland commented on GitHub (Jan 25, 2024):
I'm getting the same issue here @shellsniper
Any feedback on this from the Langchain team?
@eyurtsev commented on GitHub (Jan 25, 2024):
cc @efriis
@eyurtsev commented on GitHub (Jan 25, 2024):
Could you include versions of langchain, langchain-cli and langchain core? @alexnodeland / @shellsniper
@alexnodeland commented on GitHub (Jan 25, 2024):
Surely, here are all
Langchainrelated packages' versions @eyurtsev@efriis commented on GitHub (Jan 28, 2024):
Hey there! You should create a new app with
langchain app new hello-world. Thetemplatenamespace is for people developing new templates, not adding existing ones :)Let me know if you have any more issues!
@alexnodeland commented on GitHub (Jan 29, 2024):
Hey @efriis, thanks for the note. I used
langchain app new hello-worldto instantiate the project, and want to add a custom template, in order to develop a new template, which I will use internally. Is this not the intended pattern of use? Or should I only clone templates and modify them?I found that I can create a new template, but cannot add it to the project, as @shellsniper had pointed out. That being said, I can add it to the project with poetry manually via:
poetry add -e packages/{TEMPLATE_NAME}and then rerunningpoetry install. After I do this, I can use the template as expected. I suppose that this is the same intended effect as running,langchain app add --pip --project-dir ./packages/{TEMPLATE_NAME}?@efriis commented on GitHub (Feb 1, 2024):
Ah great case! Will add to my todo list to support those file paths better.
In the meantime, feel free to keep using your current flow. If I'm not planning on publishing templates, I often also just create files in
app/that I import intoserver.py. You can see how I did it in the Exa demo here: https://www.youtube.com/watch?v=dA1cHGACXCo