langchain
00a09e1b - docs: use PromptTemplate.from_template (#17218)

Commit
1 year ago
docs: use PromptTemplate.from_template (#17218) Ran ```python import glob import re def update_prompt(x): return re.sub( r"(?P<start>\b)PromptTemplate\(template=(?P<template>.*), input_variables=(?:.*)\)", "\g<start>PromptTemplate.from_template(\g<template>)", x ) for fn in glob.glob("docs/**/*", recursive=True): try: content = open(fn).readlines() except: continue content = [update_prompt(l) for l in content] with open(fn, "w") as f: f.write("".join(content)) ```
Author
Parents
Loading