Compare commits

...

3 Commits

Author SHA1 Message Date
Bagatur
573f4f48df fix 2023-11-15 18:10:07 -08:00
Bagatur
f1de10dc3c fix 2023-11-15 14:37:13 -08:00
Bagatur
6498565699 add 2023-11-15 14:23:57 -08:00
4 changed files with 25 additions and 8 deletions

View File

@@ -101,8 +101,8 @@
"metadata": {},
"outputs": [],
"source": [
"from langchain.prompts import PromptTemplate\n",
"from langchain.chains import LLMChain"
"from langchain.chains import LLMChain\n",
"from langchain.prompts import PromptTemplate"
]
},
{

View File

@@ -11,7 +11,7 @@ DOCS_TEMPLATES_DIR = Path(os.path.abspath(__file__)).parents[1] / "docs" / "temp
readmes = list(glob.glob(str(TEMPLATES_DIR) + "/*/README.md"))
destinations = [readme[len(str(TEMPLATES_DIR)) + 1 : -10] + ".md" for readme in readmes]
for source, destination in zip(readmes, destinations):
full_destination = DOCS_TEMPLATES_DIR / destination
full_destination = DOCS_TEMPLATES_DIR / "templates" / destination
shutil.copyfile(source, full_destination)
with open(full_destination, "r") as f:
content = f.read()
@@ -25,10 +25,24 @@ sidebar_class_name: hidden
---
"""
TEMPLATES_INDEX_DESTINATION = DOCS_TEMPLATES_DIR / "index.md"
for fn in ("index.md", "contributing.md", "launching_package.md"):
destination = DOCS_TEMPLATES_DIR / fn
with open(destination, "r") as f:
content = f.read()
# replace relative links
content = re.sub("\]\(\.\.\/", "](/docs/templates", content)
content = re.sub("\!\[.*?\]\((.*?)\)", "", content)
if fn == "index.md":
content = sidebar_hidden + content
with open(destination, "w") as f:
f.write(content)
TEMPLATES_INDEX_DESTINATION = DOCS_TEMPLATES_DIR / "templates" / "index.md"
with open(TEMPLATES_INDEX_DESTINATION, "r") as f:
content = f.read()
# replace relative links
content = re.sub("\]\(\.\.\/", "](/docs/templates/", content)
content = re.sub("\]\(\.\.\/", "](/docs/templates/templates", content)
with open(TEMPLATES_INDEX_DESTINATION, "w") as f:
f.write(sidebar_hidden + content)

View File

@@ -126,7 +126,7 @@ module.exports = {
templates: [
{
type: "category",
label: "Templates",
label: "LangChain Templates",
items: [
{ type: "autogenerated", dirName: "templates" },
],

View File

@@ -47,8 +47,11 @@ source .venv/bin/activate
python3.11 -m pip install --upgrade pip
python3.11 -m pip install -r vercel_requirements.txt
python3.11 scripts/model_feat_table.py
mkdir docs/templates
cp ../templates/docs/INDEX.md docs/templates/index.md
mkdir -p docs/templates/templates
cp ../templates/README.md docs/templates/index.md
cp ../templates/docs/CONTRIBUTING.md docs/templates/contributing.md
cp ../templates/docs/LAUNCHING_PACKAGE.md docs/templates/launching_package.md
cp ../templates/docs/INDEX.md docs/templates/templates/index.md
python3.11 scripts/copy_templates.py
cp ../cookbook/README.md src/pages/cookbook.mdx
cp ../.github/CONTRIBUTING.md docs/contributing.md