Skip to content

Commit

Permalink
add missing requirement and improve templating var name generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjoyo committed Aug 16, 2023
1 parent bb3f8b7 commit 3b43f53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ llama-index~=0.6.35
weaviate-client~=3.21.0
astunparse~=1.6.3
httpx~=0.24.1
nltk~=3.8.1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def _call(
run_manager: Optional[CallbackManagerForChainRun] = None,
) -> Dict[str, Any]:
def desc_to_var_name(desc: str):
return remove_stop_words(desc, separator='_')
v = remove_stop_words(desc, separator='_')
return re.sub(r'[^A-Za-z0-9_\'äöüÄÖÜß]+', '', v).lower()

def format_vars(template: str, f: Callable[[str], str]):
return re.sub(TEMPLATE_VAR_PATTERN, lambda m: f(m.group(1)), template)
Expand Down

0 comments on commit 3b43f53

Please sign in to comment.