Confirm sys.path includes current dir for app serve (#12851)

- Make sure sys.path is set properly for langchain app serve
- bump
This commit is contained in:
Erick Friis
2023-11-03 11:37:20 -07:00
committed by GitHub
parent 1bc35f61cb
commit 7db49d3842
3 changed files with 6 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ Manage LangChain apps
import shutil
import subprocess
import sys
from pathlib import Path
from typing import Dict, List, Optional, Tuple
@@ -219,6 +220,9 @@ def serve(
Starts the LangServe app.
"""
# add current dir as first entry of path
sys.path.append(str(Path.cwd()))
app_str = app if app is not None else "app.server:app"
host_str = host if host is not None else "127.0.0.1"